2006-06-16

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 / LevelExtreme downloads area.

https://www.levelextreme.com/Home/ShowHeader?Activator=17&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://vfpimaging.blogspot.com/p/gpimage2.html

There you can find also a FAQS link, with many samples using the class.
Download, 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://vfpimaging.blogspot.com/p/gpimage2.html

4 comments:

  1. Ailsom F. HeringerJune 16, 2006 at 4:52 PM

    Great post, Cesar !!!

    ReplyDelete
  2. 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

    ReplyDelete
  3. 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

    ReplyDelete
  4. 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"

    ReplyDelete