Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create thumbnails of 96x96 with GDI+ ?
Message
From
14/08/2006 07:55:03
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
 
To
14/08/2006 03:39:11
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01145222
Message ID:
01145251
Views:
34
This message has been marked as the solution to the initial question of the thread.
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform