Page_Load, , ASP.NET. , , ..
, HttpHandler ( Bitmap ). IHttpHandler, 2 , . - :
<%@ WebHandler Language="C#" Class="ImageHandler" %>
using System;
using System.IO;
using System.Web;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
public class ImageHandler : IHttpHandler
{
public void ProcessRequest (HttpContext context)
{
Bitmap output = new Bitmap(path);
...
context.Response.ContentType = ResponseType("Image/png");
image.Save(context.Response.OutputStream, ImageType(path));
image.Dispose();
}
public bool IsReusable
{
get { return true; }
}
}
: ... , .
HttpHandler, 50% awesome. , , , ... ; -)