GetMetaFileBitsEx function (wingdi.h)

The GetMetaFileBitsEx function retrieves the contents of a Windows-format metafile and copies them into the specified buffer.

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 GetEnhMetaFileBits.
 

Syntax

UINT GetMetaFileBitsEx(
  [in]  HMETAFILE hMF,
  [in]  UINT      cbBuffer,
  [out] LPVOID    lpData
);

Parameters

[in] hMF

A handle to a Windows-format metafile.

[in] cbBuffer

The size, in bytes, of the buffer to receive the data.

[out] lpData

A pointer to a buffer that receives the metafile data. The buffer must be sufficiently large to contain the data. If lpvData is NULL, the function returns the number of bytes required to hold the data.

Return value

If the function succeeds and the buffer pointer is NULL, the return value is the number of bytes required for the buffer; if the function succeeds and the buffer pointer is a valid pointer, the return value is the number of bytes copied.

If the function fails, the return value is zero.

Remarks

After the Windows-metafile bits are retrieved, they can be used to create a memory-based metafile by calling the SetMetaFileBitsEx function.

The GetMetaFileBitsEx function does not invalidate the metafile handle. An application must delete this handle by calling the DeleteMetaFile function.

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

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

DeleteMetaFile

GetEnhMetaFileBits

Metafile Functions

Metafiles Overview

SetMetaFileBitsEx

SetWinMetaFileBits