Scalabium Software

SMExport advertising
Knowledge for your independence'.
Home Delphi and C++Builder tips


#13: I want to generate thumbnail from image

//create the thumbnail 
int image_width = 96; 
int image_height = 96; 
Image imgThumbnail = imgOriginal.GetThumbnailImage(image_width, image_height, null, IntPtr.Zero); 
 
//save to file 
imgThumbnail.Save(Path.GetDirectoryName(AFileName) + @"\a2.bmp", ImageFormat.Bmp);

or

private bool ThumbnailCallback()
{
    return false;
}
 
private void ProcessImage(Image imgOriginal)
{
    //create the thumbnail
    int image_width = 96;
    int image_height = 96;
    Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback);
    Image imgThumbnail = imgOriginal.GetThumbnailImage(image_width, image_height, myCallback, IntPtr.Zero);
 
    //save to files
    imgThumbnail.Save(Path.GetDirectoryName(AFileName) + @"\a2.png");
}


Published: August 11, 2010

See also
 
SMDBGrid
dBase Viewer
ABA Database Convert
Mail parser (ActiveX)
Word Web-stream
Paradox ActiveX
SMReport
SMMsg suite
Viewer for MS Outlook Messages
ABA Picture Convert
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2021, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMReport Autogenerated