How to Detect the Number of Colors Available in a DCID: Q139202
|
When writing an application that uses the GDI, you may sometimes need to detect how many colors are available in the current video mode.
If you need to detect the total number of bits that are used to form a
pixel in a given display context, you can use the following algorithm:
int dBitsInAPixel = GetDeviceCaps(hdc, PLANES) *
GetDeviceCaps(hdc, BITSPIXEL);
Additional query words: 1.20 3.10 4.00 3.50 colorref rgb bpp
Keywords :
Version : 1.20 1.25a 1.30 3.10 4.00 | 3.50
Platform : NT WINDOWS
Issue type :
Last Reviewed: March 5, 1999