You can use a MemoryStream and assign it Response.OutputStream or just use Response.OutputStream directly when saving a bitmap.
There is an example in the documentation on the page, although it just saves the bitmap directly to the output stream:
// Set the correct content type, so browser/client knows what you are sending Response.ContentType = "image/jpeg"; Response.Clear(); Bitmap bmp = new Bitmap(width, height, PixelFormat.Format24bppRgb); Graphics g = Graphics.FromImage(bmp); bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
Odded
source share