Foxite.COM Community Weblog

Foxite.COM Community Weblog - free weblog service for the Visual FoxPro Community.
Welcome to Foxite.COM Community Weblog Sign in | Join | Help
in
Home Blogs Forum Photos Forum Archives

VFP IMAGING



GDIPLUS FOR ALL VFP VERSIONS

As we all know, Gdiplus.dll brings many new possibilities to VFP users.
Gdiplus.dll is a free and redistributable library provided by Microsoft, that must be used only in Windows(R) systems.

Alexander Golovlev may have been the first person to publish a class that dealed with this fantastic library. He created the class GPIMAGE.PRG, that was published in 2003 in the UniversalThread downloads area.

http://www.universalthread.com/wconnect/wc.dll?2,54,33,18584

GPIMAGE came a long time before VFP9, and is supposed to work with VFP7 and above. Probably works with previous versions, but I've not tested. It's a great library, providing a wrapper class to deal with GDI+. The original class works with the Image class, and has most functions that the GpImage class from _gdiplus.vcx brings, and some other really interesting, providing windows captures, cropping images and some other cool functions.


Under the authorization of Alexander Golovlev, and with his help and support, I added some functions to the original GPIMAGE class published in UT.

Basically we included a GRAPHICS class.
New Methods included let you draw rectangles, lines, ellipsis, pies, strings and pictures on images. Brings the possibility to control alignment, size, orientation, rotation, of any shape, text or picture.
It is possible to work with image attributes too, changing colors of images, like convert to B&W or gray scale, increase a color, etc.

This class is based on GDI+ and requires gdiplus.dll which is freely available and can be installed on Win98 and higher. If you have not installed WinXP or .NET runtime then you can download this DLL from
http://www.microsoft.com/downloads/details.aspx?FamilyID=6a63ab9c-df12-4d41-933c-be590feaa05a&DisplayLang=en

The link for the enhanced class GPIMAGE that deals with gdiplus.dll is :
http://gpimage2.googlepages.com/

There you can find also a FAQS link, with many examples of use with the class.
Download the class, and open the EXAMPLES folder, where you can find many small PRGs and forms dealing with the class.

There is a cool example of a form that changes contrast, saturation, brightness (testGpImage.Scx), another usage of a Pie Charts class (ObjPie.Prg), and also Printing Vertical or Upside Down texts in VFP reports (see TesteFrx.Prg and Teste.Frx).

The class is more recommended for people that still have not upgraded to VFP9 and need to use GDI+. It's a long time since I don't send an update to this class.
There are many other new features that can be added to the library, like getting Metadata information, gradient color brushes, etc.

Recently, I've been using my free time to develop using the new _gdiplus.vcx class and the fantastic new Sedna-X classes from Craig Boyd and Bo Durban. But if you find some difficulties or bugs working with it please tell me !
http://gpimage2.googlepages.com/

Published Friday, June 16, 2006 5:06 PM by cesarchalom
Filed Under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Ailsom F. Heringer said:

Great post, Cesar !!!
June 16, 2006 7:52 PM
 

Cesar Chalom said:

GPIMAGE FAQS

In the link below I've added some samples showing how to do some trivial tasks using GPIMAGE2
http://cchalom.sites.uol.com.br/GPIMAGE/faqs.htm
January 31, 2007 8:04 PM
 

Kaushik Ray said:

I have been in core programming in Foxpro/VFP since a decade. Presently I am researching on Biometrics/Image mapping, Image comparison etc. to write an application on Policing, Security & Survilance systems using VFP platform. Is there any such kind of possibilities to integrate these concepts in VFP.

I want to write the entire logic used behind the biometrics in VFP alongwith VFP tables and not with external databases.

If anybody has some Ideas on it. They are welcome to come ahead.

Hi, this is possible. But you'll need to get faliliarized with GDI+, specially with reading pixels using the function GetPixel, that is slow. There's another technique that permits you to load the whole image to the memory, and you can manipulate the pixels directly, in a much faster way. Look for the "Lockbits" form in the Samples folder of GdiPlusX.

Hope this helps

Cesar

May 24, 2007 6:26 PM
 

Cesar Chalom said:

This post is for people that still did not upgrade to VFP9.
As Ken Murphy said in one of his latest...
October 31, 2007 5:04 PM
 

Cesar Chalom said:

This post is for people that still did not upgrade to VFP9.
As Ken Murphy said in one of his latest...
October 31, 2007 5:05 PM

What do you think?

(required) 
(optional)
(required)