解决方法
在
Windows上,您可以将GetDeviceCaps与BITSPIXEL标志一起使用,但您首先需要屏幕DC(GetDC可以为您提供一个).
HDC dc = GetDC(NULL); int bitsPerPixel = GetDeviceCaps(dc,BITSPIXEL); ReleaseDC(NULL,dc);