>Hello,
>
>I would like to have thumbnails from JPG images.
>Like in Windows explorer, I want to have thumbnails of 96x96 pixel.
>If the image is in portrait, there will be space on the right and left side and if it's in landscape, there will be space on the top and the bottom.
>
>My idea was to use gdiplus like this :
>- create a blank image of 96x96 (OK)
>- resize the image to fit in the blank one (OK)
>- Paste the resized image in the blank one (Can't find how...)
>
>In gdiplus, I can't find how to paste an image into another...
>
>Any tips ?
>
>Thanks,
>Regards
>Steph
PROCEDURE ResizeImage
LPARAMETERS cSourceImage,cOutputImage, nW, nH
#DEFINE GDIPLUS_PIXELFORMAT_32bppPARGB 0x000E200B
LOCAL oImage, oGraphics, oBitmap, nW, nH
oImage = NEWOBJECT('gpImage','_gdiplus.vcx')
oImage.CreateFromFile( cSourceImage )
oBitmap = NEWOBJECT('gpBitmap', '_gdiplus.vcx')
oGraphics = NEWOBJECT('gpGraphics', '_gdiplus.vcx')
oBitmap.Create( nW, nH, GDIPLUS_PIXELFORMAT_32bppPARGB)
oGraphics.CreateFromImage(oBitmap)
oGraphics.DrawImageScaled( oImage, 0, 0, nW, nH)
oBitmap.SaveToFile( cOutputImage, 'image/png')
replace image/png if you want