BOOL PlayMetaFile(hdc, hmf) | |||||
HDC hdc; | /* handle of device context | */ | |||
HMETAFILE hmf; | /* handle of metafile, */ |
The PlayMetaFile function plays the contents of the specified metafile on the given device. The metafile can be played any number of times.
hdc
Identifies the device context of the output device.
hmf
Identifies the metafile to be played.
The return value is nonzero if the function is successful. Otherwise, it is zero.
The following example uses the CreateMetaFile function to create a device-context handle of a memory metafile, draws a line in the device context, retrieves a metafile handle by calling the CloseMetaFile function, plays the metafile by using the PlayMetaFile function, and finally deletes the metafile by using the DeleteMetaFile function:
HDC hdcMeta;
HMETAFILE hmf;
hdcMeta = CreateMetaFile(NULL);
MoveTo(hdcMeta, 10, 10);
LineTo(hdcMeta, 100, 100);
hmf = CloseMetaFile(hdcMeta);
PlayMetaFile(hdc, hmf);
DeleteMetaFile(hmf);