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:

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...