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/ViewPageNewDownload.aspx?ID=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 (from the VFP9 FFC) 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 VFPX classes - aka GDIPLUSX.
http://gpimage2.googlepages.com/

5 Responses to GDIPLUS FOR ALL VFP VERSIONS

  • Ailsom F. Heringer says:

    Great post, Cesar !!!

  • Cesar Chalom says:

    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

  • Kaushik Ray says:

    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

  • Tommy Tillman says:

    The download links for gpimage2 do not work anymore.    Where can I download the latest version?   The one on the UT does not do the monochrome conversion, neither does it do TEST.prg or other sample programs that come with the one at UT.   It does run the RESIZE sample.

    It crashed out when it tried to do

    oGr = CREATEOBJECT("graphics",img.GetImage())….  could not find the class "graphics"

  • Benedikt Torok says:

    Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *