//Getting Thumbnail of orginal Image
public void GetThumbnail()
{
//Just an
simple call back.
Image.GetThumbnailImageAbort myCallback =
new
Image.GetThumbnailImageAbort(ThumbnailCallback);
//Getting
image from the path.
Bitmap
myBitmap = new Bitmap(Server.MapPath("scenary.jpg"));
//Convert
Image as Thumbnail with given size.
Image
myThumbnail = myBitmap.GetThumbnailImage(
40, 40, myCallback, IntPtr.Zero);
//Get the
current response
HttpResponse
response = GetHttpResponse();
//Saves
image to the Page in the PNG format
myThumbnail.Save(response.OutputStream, ImageFormat.Png);
}
public bool ThumbnailCallback()
{
return
false;
}
Thanks for reading this article. Have a nice day.