Monthly Archives: November 2007

updated: fixed image size, thanks to christof wollenhaupt


more than once i've seen people asking to create images containing some text. the sample below is really very simple.

  • creates a font
  • measures the space that the text will need
  • creates an image with the needed size
  • draws the string
  • saves to disk

requires vfp9 and gdiplusx to run. 
please make sure that you have the latest version, because this sample may be using some functions that were added or fixed recently.


do locfile("system.prg")

with _screen.system.drawing
   local lctext
   lctext = "gdiplusx is… Continue reading

updated code - fixed bug reported by jean pierre senet in the graphics initialization. merci beaucup jean !


the function below converts any button image to a bmp to be used in vfp forms.

there are lots of cool and free icons available on the web, but the vast majority are in .ico, gif or png image formats, that are not very familiar and reliable to be used in vfp. for us, the best image format, for a lot of reasons, is the bmp format.

some transformations are needed to make this bmp to show exactly how we desire, specially… Continue reading

This week calvin hsia came with a very interesting post, extract treeview or listview imagelist icons from a dll .

That calvin's post is dedicated to visual studio developers.

As in the comments there were some people asking the code for vfp, below i'm putting and adapted version for vfp users, using, of course, gdiplusx to help us extracting the icons from the resource.


There's still more to say about this, but in this first moment, i'm putting just the code to retrieve the embedded bitmap from the visual studio dll that calvin refers to. below is… Continue reading

here's the link of a utmag article that covers the tiff subject deeply:
tiff and the new gdiplusx classes

at the topic "extracting frames from tiffs" you'll find the code below, that saves the frames of a tiff in separate image files:

** howto: extract frames from a multiframe tiff

do locfile("system,prg")

with _screen.system.drawing

* load the multiframe tiff to gdi+
local lomultif as xfcbitmap
lomultif ="tif"))
local lnframes, n, lcframefilename
lnframes = lomultif.getframecount()
if lnframes > 1
   for n = 0 to lnframes - 1
      lomultif.selectactiveframe(.imaging.framedimension.… Continue reading