SetMetaFileBitsEx function (wingdi.h)

The SetMetaFileBitsEx function creates a memory-based Windows-format metafile from the supplied data.

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

Syntax

HMETAFILE SetMetaFileBitsEx(
  [in] UINT       cbBuffer,
  [in] const BYTE *lpData
);

Parameters

[in] cbBuffer

Specifies the size, in bytes, of the Windows-format metafile.

[in] lpData

Pointer to a buffer that contains the Windows-format metafile. (It is assumed that the data was obtained by using the GetMetaFileBitsEx function.)

Return value

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

If the function fails, the return value is NULL.

Remarks

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

When the application no longer needs the metafile handle returned by SetMetaFileBitsEx, it should delete it by calling the DeleteMetaFile 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

GetMetaFileBitsEx

Metafile Functions

Metafiles Overview

SetEnhMetaFileBits

SetWinMetaFileBits