GetPixelFormat function (wingdi.h)

The GetPixelFormat function obtains the index of the currently selected pixel format of the specified device context.

Syntax

int GetPixelFormat(
  HDC hdc
);

Parameters

hdc

Specifies the device context of the currently selected pixel format index returned by the function.

Return value

If the function succeeds, the return value is the currently selected pixel format index of the specified device context. This is a positive, one-based index value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

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

ChoosePixelFormat

DescribePixelFormat

OpenGL on Windows

SetPixelFormat

Windows Functions