Click to Rate and Give Feedback
MSDN
MSDN Library
Windows GDI
Metafiles
Metafile Reference
Metafile Functions
 PlayMetaFile
Windows GDI
PlayMetaFile

The PlayMetaFile function displays the picture stored in the given Windows-format metafile on the specified device.

Note  This function is provided only for compatibility with Windows-format metafiles. Enhanced-format metafiles provide superior functionality and are recommended for new applications. The corresponding function for an enhanced-format metafile is PlayEnhMetaFile.

BOOL PlayMetaFile(
  HDC hdc,        // handle to DC
  HMETAFILE hmf   // handle to metafile
);

Parameters

hdc
[in] Handle to a device context.
hmf
[in] Handle to a Windows-format metafile.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Windows NT/2000/XP: To get extended error information, call GetLastError.

Remarks

To convert a Windows-format metafile into an enhanced format metafile, use the SetWinMetaFileBits function.

A Windows-format metafile can be played multiple times.

A Windows-format metafile can be embedded in a second Windows-format metafile by calling the PlayMetaFile function and playing the source metafile into the device context for the target metafile.

Any object created but not deleted in the Windows-format 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.

Requirements

  Windows NT/2000/XP/Vista: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Wingdi.h; include Windows.h.
  Library: Use Gdi32.lib.

See Also

Metafiles Overview, Metafile Functions, CancelDC, SetWinMetaFileBits


Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content      
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker