public bool ThumbnailCallback()
{
return false;
}
Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback);
Image myThumbnailPicture;
Image imageFile = Image.FromFile(strPath);
int newWidth, newHeight;
newWidth = 400;
newHeight = (int)((float)newWidth * imageFile.Height / imageFile.Width);
Bitmap myBitmap = new Bitmap(imageFile);
Image myThumbnail = myBitmap.GetThumbnailImage(newWidth, newHeight, myCallback, IntPtr.Zero);
string strTempPicture = "ThumbnailImage.jpg";
myThumbnail.Save(strTempPicture, ImageFormat.Jpeg);