Skip to main content

Posts

Showing posts with the label Image

Dynamically Generating Images using ASP.NET Handler

Dynamically Generating Images using ASP.NET Handler IIS by default looks for images in files system. But sometime we need to produce those images dynamically. We can either pre-generate those images or configure IIS to forward request to our ASP.NET application. Create a class that implements IHttpHandler . One can do synchronous or asynchronous( IHttpAsyncHandler ) processing. Implement IsReuseable property and ProcessRequest (HttpContext) method. IsResuseable true means IHttpHandlerFactory will put this IHttpHandler in pool for later use to improve the performance,      public class GetNameImage : IHttpHandler     {         public void ProcessRequest (HttpContext context)         {             Bitmap vImg = new Bitmap(300, 150);             Graphics g = Graphics.FromImage(vImg)...