Monthly Archives: June 2006

In my previous post with the same title, I showed how to create vertical gradient backgrounds in forms. as commented by Malcolm Greene, that same technique can be used to VFP containers.

According to MSDN, "the lineargradientbrush class defines a brush that paints a color gradient in which the color changes evenly from the starting boundary line of the linear gradient brush to the ending boundary line of the linear gradient brush. the boundary lines of a linear gradient brush are two parallel straight lines. The color gradient is perpendicular to the boundary lines of the linear… Continue reading

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

http://www.universalthread.com/ViewPageNewDownload.aspx?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… Continue reading

After reading this post, read also: Gradient backgrounds in your forms with gdi+ part 2

 

1000.107.1822.GpGradient21000.107.1821.GpGradient1

 

Gdi+ brings us the possibility to create many cool effects such as gradient colors. this feature was not included in _gdiplus.vcx, but can also be accessed easily with a simple call to the flat api. a great part of the codes below that are related to the creation of the gradient brush is from bo durban.

To apply this to forms is really easy. add the codes below to the load, resize and destroy events of any form:

 

load event

local lcgradfile… Continue reading

The method savetofile from GpImage class in _GdiPlus.vcx from vfp9 FFC “saves the image object to a disk file, using specified encoder or image format and optional parameters.”

Here are the most important:

 

quality (supported by jpeg)

Specifies the compression level when you save a jpeg image. a quality level of 0 corresponds to the greatest compression, and a quality level of 100 corresponds to the least compression.

Sample 1: Aaves image with quality of 70%

local lcsource
lcsource = getpict()
local loimage as gpimage of home() + ffc/_gdiplus.vcx
loimage = newobject("gpimage", home() + "ffc/_gdiplus.vcx")… Continue reading