SetEnhMetaFileBits

The SetEnhMetaFileBits function creates a memory-based enhanced-format metafile from the supplied data.

HENHMETAFILE SetEnhMetaFileBits(
  UINT cbBuffer,      // buffer size
  CONST BYTE *lpData  // buffer that contains enhanced metafile data
);
 

Parameters

cbBuffer
Specifies the size, in bytes, of the data provided.
lpData
Pointer to a buffer that contains enhanced-metafile data. (It is assumed that the data in the buffer was obtained by calling the GetEnhMetaFileBits function.)

Return Values

If the function succeeds, the return value is a handle to a memory-based enhanced metafile.

If the function fails, the return value is NULL.

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

Remarks

When the application no longer needs the enhanced-metafile handle, it should delete the handle by calling the DeleteEnhMetaFile function.

The SetEnhMetaFileBits function does not accept metafile data in the Windows format. To import Windows-format metafiles, use the SetWinMetaFileBits function.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in wingdi.h.
  Import Library: Use gdi32.lib.

See Also

Metafiles Overview, Metafile Functions, DeleteEnhMetaFile, GetEnhMetaFileBits, SetWinMetaFileBits