The DescribePixelFormat function obtains information about the pixel format identified by iPixelFormat of the device associated with hdc. The function sets the members of the PIXELFORMATDESCRIPTOR structure pointed to by ppfd with that pixel format data.
int DescribePixelFormat(
HDC hdc, // device context of interest
int iPixelFormat, // pixel format selector
UINT nBytes, // size of buffer pointed to by ppfd
LPPIXELFORMATDESCRIPTOR ppfd
// pointer to structure to receive pixel
// format data
);
If the function succeeds, the return value is the maximum pixel format index of the device context. In addition, the function sets the members of the PIXELFORMATDESCRIPTOR structure pointed to by ppfd according to the specified pixel format.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The following code sample shows DescribePixelFormat usage:
PIXELFORMATDESCRIPTOR pfd;
HDC hdc;
int iPixelFormat;
iPixelFormat = 1;
// obtain detailed information about
// the device context's first pixel format
DescribePixelFormat(hdc, iPixelFormat,
sizeof(PIXELFORMATDESCRIPTOR), &pfd);
Windows NT: Use version 3.5 and later.
Windows: Use Windows 95 and later.
Windows CE: Unsupported.
Header: Declared in wingdi.h.
Import Library: Link with gdi32.lib.
OpenGL on Windows NT and Windows 95 Overview, Win32 Functions, ChoosePixelFormat, GetPixelFormat, SetPixelFormat