This sample code shows how to create a ThumbNail image of width and Height 250 X 250 and save the Thumbnail Image in the Images folder of the Application.
private void SaveThumbNail (string folder, string filename) { System.Drawing.Image image = System.Drawing.Image.FromFile(folder + filename); System.Drawing.Image thumbnailImage = image.GetThumbnailImage(250, 250, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero); string thumbnailPath = folder + "\Thumbnail.JPG"; thumbnailImage.Save(thumbnailPath, System.Drawing.Imaging.ImageFormat.Jpeg); }
/// /// Required, but not used /// /// true public bool ThumbnailCallback() { return true; }
|
No responses found. Be the first to respond and make money from revenue sharing program.
|