Monthly Archives: March 2006

Did you know that it is possible to draw pie style graphics in vfp without the need of any active-x or api call ? with pure vfp code ? draw a circle with foxpro
To draw any circle, there are two main parameters : 1 point with the coordinates of the center of the circle (x,y) and the radius. having this, it is very simple to calculate the coordinates of any point in the circumference border.
Even if you already use gdi+ or any active-x to draw graphics, i think it's imteresting to know how a circle is built, and… Continue reading

I always see people asking how to create graphics without active-x controls.

In my opinion, the most simple way to do it is to use labels. labels are versatile, we can change their backcolor, caption, width, height. These four properties are all we need to create a simple graphic, like in this picture below.

The graphic is drawn in a container. we can set the label color to the bar color, in its caption we can store the values, its height is proportional to the value, and the width depends on the division between the container's width and the wuantity… Continue reading

This short but powerful example makes use of many API calls, for memory access and data conversion to the clipboard. Does not require any ocx and works with vfp from version 5 to 9. The author created it because many people have been looking for tools to capture images from webcams and other image accessories linked to the programs. This sample shows again that we can do many cool things with visual foxpro. Have a look at what he's done with a simple form !

This is one of my preferred codes from my colleague from the brazilian forum http://www.vfpbrasil.com.br/… Continue reading

It's very common to need to draw some shapes, texts or to apply some effects to images.
But GDI+ has a limitation when working with images created in indexed pixel formats, such as 1bppindexed (0x00030101), 4bppindexed (0x00030402) and 8bppindexed (0x00030803). these are the pixel formats used by gif (graphics interchange format) files too. if you try to draw on these kind of images you may receive an error message like this :

A very simple solution is to load the gif using gpimage, and retrieve some properties, like width and height. then create a new and empty bitmap object with… Continue reading

Did you know that all the jpegs from your digital camera contain a lot of extra information ?

We can easily retrieve some interesting information such as : title, equipment make, camera model, shutter speed, lens aperture, flash mode, date of picture, and much more ! these metadata "tags" are stored in a jpeg file to indicate various camera settings and picture taking conditions that occurred while creating the photo. several image file formats enable you to store metadata along with an image, such as jpeg, tiff and png.

Again GDI+ makes our lives easier, providing to us a function… Continue reading

local lcsource, lcinfo, lnwidth, lnheight, lnhorres, lnverres, lnpixform
lcsource = getpict()

local loimage as gpimage of ffc/_gdiplus.vcx
loimage = newobject("gpimage", home() + "ffc/_gdiplus.vcx")
loimage.createfromfile(lcsource)

lnwidth = loimage.imagewidth
lnheight = loimage.imageheight
lnhorres = loimage.horizontalresolution
lnverres = loimage.verticalresolution
lnpixform = loimage.pixelformat
lcpixform = getpixformatname(lnpixform)

lcinfo = "image : " + lcsource + chr(13) + chr(13) +;
   "width : " + transform(lnwidth) + " pixels" + chr(13) +;
   "height : " + transform(lnheight) + " pixels" + chr(13) +;
   "pixel format : " + lcpixform + chr(13)… Continue reading