Streaming a PNG file into Response.OutputStream?
Posted by: Rick Strahls WebLog,
on 14 Jun 2006 |
View original
Hmmm… I’m working on an HTTP handler that is returning an image as its end result. The image generation works fine and a generic routine returns a Bitmap image as a result. Finally I write out the image like this:
Bitmap bmp = wwWebUtils.CornerImage(backcolor, color, c, Radius, Height, Width);
// *** Works:
//bmp.Save(@"c:\projects2005\wwStore\corner.png", ImageFormat.Png);
// *** Doesn’t work
Response.ContentType = "image/png";
bmp.Save(Response.OutputStream,ImageFormat.Png);
This...