This topic has not yet been rated - Rate this topic

PlayEnhMetaFile function

Applies to: desktop apps only

The PlayEnhMetaFile function displays the picture stored in the specified enhanced-format metafile.

Syntax

BOOL PlayEnhMetaFile(
  __in  HDC hdc,
  __in  HENHMETAFILE hemf,
  __in  const RECT *lpRect
);

Parameters

hdc [in]

A handle to the device context for the output device on which the picture will appear.

hemf [in]

A handle to the enhanced metafile.

lpRect [in]

A pointer to a RECT structure that contains the coordinates of the bounding rectangle used to display the picture. The coordinates are specified in logical units.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

When an application calls the PlayEnhMetaFile function, the system uses the picture frame in the enhanced-metafile header to map the picture onto the rectangle pointed to by the lpRect parameter. (This picture may be sheared or rotated by setting the world transform in the output device before calling PlayEnhMetaFile.) Points along the edges of the rectangle are included in the picture.

An enhanced-metafile picture can be clipped by defining the clipping region in the output device before playing the enhanced metafile.

If an enhanced metafile contains an optional palette, an application can achieve consistent colors by setting up a color palette on the output device before calling PlayEnhMetaFile. To retrieve the optional palette, use the GetEnhMetaFilePaletteEntries function.

An enhanced metafile can be embedded in a newly created enhanced metafile by calling PlayEnhMetaFile and playing the source enhanced metafile into the device context for the new enhanced metafile.

The states of the output device context are preserved by this function. Any object created but not deleted in the enhanced metafile is deleted by this function.

To stop this function, an application can call the CancelDC function from another thread to terminate the operation. In this case, the function returns FALSE.

Examples

For an example, see Opening an Enhanced Metafile and Displaying Its Contents.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Metafiles Overview
Metafile Functions
CancelDC
GetEnhMetaFileHeader
GetEnhMetaFilePaletteEntries
RECT

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ