GetEnhMetaFilePixelFormat function (wingdi.h)

The GetEnhMetaFilePixelFormat function retrieves pixel format information for an enhanced metafile.

Syntax

UINT GetEnhMetaFilePixelFormat(
  HENHMETAFILE          hemf,
  UINT                  cbBuffer,
  PIXELFORMATDESCRIPTOR *ppfd
);

Parameters

hemf

Identifies the enhanced metafile.

cbBuffer

Specifies the size, in bytes, of the buffer into which the pixel format information is copied.

ppfd

Pointer to a PIXELFORMATDESCRIPTOR structure that contains the logical pixel format specification. The metafile uses this structure to record the logical pixel format specification.

Return value

If the function succeeds and finds a pixel format, the return value is the size of the metafile's pixel format.

If no pixel format is present, the return value is zero.

If an error occurs and the function fails, the return value is GDI_ERROR. To get extended error information, call GetLastError.

Remarks

When an enhanced metafile specifies a pixel format in its ENHMETAHEADER structure and the pixel format fits in the buffer, the pixel format information is copied into ppfd. When cbBuffer is too small to contain the pixel format of the metafile, the pixel format is not copied to the buffer. In either case, the function returns the size of the metafile's pixel format.

For information on metafile recording and other operations, see Enhanced Metafile Operations.

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
Library Gdi32.lib
DLL Gdi32.dll

See also

ENHMETAHEADER

OpenGL on Windows

PIXELFORMATDESCRIPTOR

Windows Functions