Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create thumbnails of 96x96 with GDI+ ?
Message
De
14/08/2006 07:55:03
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
 
 
À
14/08/2006 03:39:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01145222
Message ID:
01145251
Vues:
32
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform