Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
JPG Thumbnails
Message
 
À
26/02/2003 15:46:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00758418
Message ID:
00758626
Vues:
20
>Is it possible to create a thumbnail of a jpg file in foxpro? I don't want to just show a reduced image but I want to save a thumbnail of the image to disk. And if it is possible to do can some one point me to some sample code even if it's an API call?

Eric,

The GDI+ image class is sent to you by email. To use it you must have GDI+ installed. It already installed if you have WinXP or .NET runtime. Otherwise it can be downloaded from http://download.microsoft.com/download/platformsdk/redist/3097/W98NT42KMeXP/EN-US/gdiplus_dnld.exe
To create thumbnail you can use Thumbnail or Resize methods:
#include gpImage.h
If Not "gpImage" $ Set("Procedure")
	Set Procedure To gpImage Additive
EndIf

* Initialize GDI+
* This object must exist all the time when GDI+ is used
gdip = CreateObject("gpInit")

img = CreateObject("gpImage")

* Create thumbnail 96*72 and store as JPEG
img.Load("support.jpg")
img.Thumbnail(96, 72)
img.SaveAsJPEG("test1.jpg")

* Resize image and store as TIFF
img.Load("support.jpg")

w = img.ImageWidth / 2
h = img.ImageHeight / 2
img.Resize(w, h, InterpolationModeHighQuality)
img.SaveAsTIFF("test2.tif", EncoderValueCompressionLZW)
HTH,
Alexander
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform