GetEnhMetaFileBits

  UINT GetEnhMetaFileBits(hemf, cbBuffer, lpbBuffer)    
  HENHMETAFILE hemf; /* handle of metafile */
  UINT cbBuffer; /* size of data buffer */
  LPBYTE lpbBuffer; /* address of data buffer */

The GetEnhMetaFileBits function retrieves the contents of the specified enhanced metafile and copies them into the buffer at which lpData points.

Parameters

hemf

Identifies the enhanced metafile.

cbBuffer

Specifies the size, in bytes, of the buffer reserved for the data. Only this many bytes will be written.

lpbBuffer

Points to the buffer to receive the metafile data. The buffer must be sufficiently large to contain the data. If lpData is NULL, the function returns the size necessary to hold the data.

Return Value

If the function is successful and lpData is NULL, the return value specifies the size of the enhanced metafile in bytes; if the function is successful and lpData is a valid pointer, the return value specifies the number of bytes copied. The return value is 0 if an error occurs.

Comments

Once the enhanced metafile bits are retrieved, they can be used to create a memory-based metafile by calling the SetEnhMetaFileBits function.

The GetEnhMetaFileBits function does not invalidate the enhanced metafile handle hemf. An application should free the handle by calling the DeleteEnhMetaFile function when it no longer needs the handle.

The metafile contents retrieved in this function is in the enhanced format. To retrieve the metafile contents in the Windows 3.0 format, use the GetWinMetaFileBits function.

See Also

DeleteEnhMetaFile, GetWinMetaFileBits, SetEnhMetaFileBits