GetPixelFormat  ZX.X9A 

[New - Windows 95, OEM Service Release 2]

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

int GetPixelFormat(

    HDC  hdc

// device context whose currently selected pixel format index is sought

   );

 

 

Parameters

hdc

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

 

Return Values

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

Remarks

The following code sample shows GetPixelFormat usage:

 

PIXELFORMATDESCRIPTOR  pfd;

HDC  hdc;

int  iPixelFormat;

 

// get the current pixel format index

iPixelFormat = GetPixelFormat(hdc);

 

// obtain a detailed description of that pixel format

DescribePixelFormat(hdc, iPixelFormat,

        sizeof(PIXELFORMATDESCRIPTOR), &pfd);

 

See Also

ChoosePixelFormat, DescribePixelFormat, SetPixelFormat