Visit Gigasoft's Web Site
 ProEssentials v9 Help

PEcopymetatofile

BOOL PEcopymetatofile (hObject, lpPoint, lpszFilename)

 

HWND 

hObject

The handle returned from PEcreate.

POINT* 

lpPoint

Pointer to POINT struct holding size.

WCHAR* 

lpszFilename

Pointer to a null-terminated string naming file.

 

This function places the current image, in the form of a metafile, into a file named by lpszFilename. It is recommended that ExportImageDPI or DpiX/DpiY is non-zero.

 

The metafile created is a standard metafile, not an enhanced metafile. Standard metafiles do not support 32 bit colors so RenderEngine is set to Gdi when building the image for metafile export. Also BitmapGradientMode is best set to False, or bitmap/gradient sections will show as transparent within the created metafile. Also, standard metafiles do not support Unicode strings, if using a double byte character set, see WideCharToMultiByte and CodePage properties.

Parameter

Description

lpPoint

Pointer to a POINT struct where POINT.x stores the width and POINT.y stores the height. The dimensions are in 1/100th of a millimeter. The dimensions must not equal zero. To insure image quality, the aspect ratio (width/height) must be between 0.333 and 10.0

lpszFilename

This pointer must identify a valid filename.

 

Returns

NonZero if the function was successful, otherwise Zero.

 

Comments

.NET developers, see PeFunction.Image.MetafileToFile

 

Ocx|Vcl developers, see the PEactions property.

 

With OCX interface, you can call this function as follows...

Pego1.PEnarg1 = 'width in pixels

Pego1.PEnarg2 = 'height in pixels

Pego1.PEstrarg1 = 'filename

Pego1.PEactions = 13 ' Calls PEcopymetatofile

 

In Delphi, use...

PEGraph1.PEnarg1 := {width in pixels};

PEGraph1.PEnarg2 := {height in pixels};

PEGraph1.PEstrarg1 := {filename};

PEGraph1.PEactions := gMetaToFile; {Calls PEcopymetatofile}