デバイス コンテキストの現在のピクセル形式を調べる
GetPixelFormat 関数と DescribePixelFormat 関数を使用して、次のコード フラグメントに示すように、デバイス コンテキストの現在のピクセル形式を調べます。
PIXELFORMATDESCRIPTOR pfd;
HDC hdc;
int iPixelFormat;
// if the device context has a current pixel format ...
if (iPixelFormat = GetPixelFormat(hdc)) {
// obtain a detailed description of that pixel format
DescribePixelFormat(hdc, iPixelFormat,
sizeof(PIXELFORMATDESCRIPTOR), &pfd);
}