Monthly Archives: May 2006

Cropping an image is a simple task for gdiplus.
One of the ways that this can be done is using the gdi+ function gdipclonebitmapareai , that unfortunately was not included in _gdiplus.vcx, but can be easily accessed.

 

Original Image

Original image

 

 

1000.107.1586.Crop-TopLeft 1000.107.1584.Crop-Center 1000.107.1583.Crop-BottomRight

top left

center

bottom right

 

Run the code below, selecting any image, and you will see the image cropped in three ways: the top-left part of the image, the bottom-right part, and the center.

 

local lcSource
lcSource = getpict()

if empty(lcsource)
   return
endif
* Load image to GDI+
local loImage as gpImage… Continue reading

I've seen all over the web some examples showing how to print individual images directly to the printer.

I don't know why, but in some situations this approach simply denies to work. maybe, or probably a developer bug ?

One of the easiest and more secure ways to do this task is to use the native report designer, and let vfp deal with the whole process of printing.

Below there is an example that receives an image file name as a parameter, creates a report on the fly, adding an ole image object that will print the selected image.

This… Continue reading