Visit Gigasoft's Web Site
 ProEssentials v10 Help

PEcopyemftoclipboard

BOOL PEcopyemftofile (hObject, lpPoint, nEmfType, nEmfDC, bEmfBitmapGradients, hRefDC)

 

HWND 

hObject

The handle returned from PEcreate.

POINT* 

lpPoint

Pointer to POINT struct holding size.

int 

nEmfType

Controls the format of enhanced metafile. See below for more info.

int 

nEmfDC

Controls the Device Context used in recording the enhanced metafile. See below for more info.

BOOL 

bEmfBitmapGradients

Controls if enhanced metafile will include background bitmaps and gradients.

int 

hRefDC

Normally left zero and above nEmfDC selects the working device context. If non-zero, this parameter should identify a device context handle to be used for creating / recording enhanced metafile.

 

This function places the current image, in the form of an enhanced metafile, onto the clipboard. It is recommended that ExportImageDPI is set to 300 DPI.

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

nEmfType

PEET_EMF_GDI (0)

Legacy GDI enhanced metafile, converted via GDIPlus to simulate GDIPlus within GDI . Highly supported.

Dual format: renders as GdiPlus if available, else renders as Gdi if GdiPlus is not available. File size is usually quite large. MS Office and Adobe supported, though large sized fonts tend to be quirky. Test for Adobe support if you want to print to a PDF. Hopefully Microsoft will improve their poor support for this image format.

Renders as GdiPlus only. File size is very small. GdiPlus must be present and this format has limited support. MS Office/Adobe may not fully support. Test thoroughly if using this setting. Hopefully more support will arrive as file-size and image-quality is best within this format.

nEmfDC

PEEDC_DISPLAY_DPI_ADJ (0)

Uses the current video display Device Context. Metafile header is not modified, and DPI of the metafile will match the DPI of the video display. Best if export will only be viewed on a monitor and never printed.

Uses the current default printer driver. This setting may be the best solution if ExportImageDpi will be set to 300 DPI.

bEmfBitmapGradients

If True, file sizes may be large and radial gradients may show artifacts when nEmfType is 0. Linear gradients are well supported. If False and BitmapGradientMode = True, then the background region will be transparent. In this case, it's best to use black or dark colored chart text.

hRefDC

See the Windows CreateEnhMetafile API call for more info on the hRefDC parameter. Usually left zero.

 

Returns

NonZero if the function was successful, otherwise Zero.

 

Comments

The metafile created is an Enhanced Metafile or Enhanced Plus Metafile (supporting GdiPlus). Standard metafiles are exported with PEcopymetatoclipboard.

 

.NET developers, see PeFunction.Image.EmfToClipboard

 

Ocx|Vcl developers, see the PEcopyemftoclipboard method.

 

Delphi developers, call this function directly as defined within PEGRPAPI.PAS.

 

See also: PEcopyemftofile, PEcopyemftohglobal, PEgetenhancedmeta