BOOL PlayEnhMetaFile(hdc, hemf, lpRect) | |||||
HDC hdc; | /* handle of a device context | */ | |||
HENHMETAFILE hemf; | /* handle of an enhanced metafile | */ | |||
LPRECT lpRect; | /* address of bounding rectangle | */ |
The PlayEnhMetaFile function displays the picture stored in the specified enhanced metafile.
hdc
Identifies the device context for device upon which the picture will appear.
hemf
Identifies the enhanced metafile.
lpRect
Points to a RECT structure that contains the coordinates of the bounding rectangle that is used to display the picture. The coordinates are specified in logical units.
The RECT structure has the following format:
typedef struct tagRECT { /* rc */
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;
The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.
When an application calls the PlayEnhMetaFile function, Windows uses the picture frame in the enhanced-metafile header to map the picture onto the rectangle at which lpRect points. (This rectangle may be sheared or rotated prior to calling PlayEnhMetaFile.) Points along the edges of the rectangle at which lpRect points 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.
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 in this function. Any object created but not deleted in the enhanced metafile is deleted by this function.
To abort this function, an application can call CancelDC from another thread to terminate the operation. In this case, the function will return FALSE.
CancelDC, SetWorldTransform, GetEnhMetaFileHeader