Saturday, September 18, 2010

How to write a dynamically created bitmap file to response output stream

Thumbnail thumbnail = new Thumbnail(url, 800, 600, width, height);
Bitmap image = thumbnail.GenerateThumbnail();
this.Response.Clear();
this.Response.ClearHeaders();
image.Save(this.Response.OutputStream, ImageFormat.Bmp);
this.Response.ContentType = "image/bmp";
this.Response.AddHeader("content-disposition""attachment;filename=Thumbnail.bmp");
HttpContext.Current.ApplicationInstance.CompleteRequest();

No comments:

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...