Expand
PlayMetaFile Function

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.

Syntax

BOOL PlayMetaFile(
  __in  HDC hdc,
  __in  HMETAFILE hmf
);

Parameters

hdc [in]

Handle to a device context.

hmf [in]

Handle to a Windows-format metafile.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

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

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
SetWinMetaFileBits

 

 

Send comments about this topic to Microsoft

Build date: 5/4/2010

Community ContentAdd
Page view tracker