Skip to content

Instantly share code, notes, and snippets.

@davidglezz
Created November 4, 2013 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidglezz/7305041 to your computer and use it in GitHub Desktop.
Save davidglezz/7305041 to your computer and use it in GitHub Desktop.
Get the number of color bits in the current screen device.
int GetColorsBits()
{
HDC hScreenDC = GetDC(0);
int nColorBits = GetDeviceCaps(hScreenDC, BITSPIXEL) * GetDeviceCaps(hScreenDC, PLANES);
ReleaseDC(NULL, hScreenDC);
return nColorBits;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment