Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
JPG Thumbnails
Message
 
To
26/02/2003 15:46:20
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00758418
Message ID:
00758626
Views:
16
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform