Monthly Archives: January 2007

Some days ago I posted a solution based on Alexander Golovlev's GpImage Gdi+ class showing how to send an image to the clipboard.

We agreed that although this function is not present originally on the "system.drawing" namespace from .net, it could represent a good addiction to the gdiplus-x livrary for vfp. so, the function "toClipboard()" was added to the bitmap class.

From now on, I mean from gdiplus-X release 0.07 and forward, we can send any Gdi+ compatible image to the clipboard using the new "toClipboard()" function just added to the bitmap class using the simple… Continue reading

A strange error occured for some people when using some of the samples for the creation of gradients that I've been providing in this blog.

Some people reported that the original code was creating a black image instead of a gradient. in other cases, the error "cannot load 32-bit dll gdiplus" occured.

This happened because vfp was using different versions of gdiplus.dll installed on the machine. one version to draw the gradient and another version to draw just the gradients. if the machine had only one version of gdiplus.dll installed, even with more than one copy, all went ok.… Continue reading

To capture a screen with Gdiplus-X is a very easy task too.
basically, all we need to do is to call the fromscreen() method from the bitmap class. To ease this task, this method brings some different overloads.



All samples below use the Gdiplus-x library from VFPX. Download the latest stable release from codeplex:


1 - capture a form screen sending the hwnd of the form or the form as an object 

do locfile("") 

local locapturebmp as xfcbitmap
with _screen.system.drawing
locapturebmp = .bitmap.fromscreen(thisform.hwnd)
* could… Continue reading 

Referring to a previous post, from may 2006 entitled "Print individual images", Naomi Nosonovsky asks for the possibility to obtain a better control over the image.

That's really easy, and the original code needed a very simple modification, in a first moment clearing and then sending the desired information to the expr field of the report table.

The EXPR, TAG, and TAG2 columns in the header record are used for printer setup attributes.

In some limited cases, we may edit the values in the expr column and, if these values are reasonable for the associated attributes, they will… Continue reading


All samples below use the new GdiPlus-X library, from VFPX



** the following code example demonstrates how to send an
** image to the clipboard
** sample totally based on the method "toclipboard" from gpimage gdi+ class
** from alexander golovlev

    LOCAL lobmp AS xfcbitmap
    lobmp =
    LOCAL lhbitmap, hbmp, hndl
    lhbitmap = lobmp.gethbitmap(.COLOR.lightgray)

    #DEFINE err_clipnotopen "cannot open… Continue reading