0

I'm struggling to find any win32 api call that can correctly identify the bit depth of a connected monitor in terms of bits per channel. The attached screenshot shows the setting visible.

With DXGI it is possible to enumerate all modes on an output and identify their bit depth easily, however there is no call to get the current mode.

All current win32 calls which return bitsPerPel always indicate 32bpp.

Does anybody know which call can get this data? I can detect this with NvAPI and ADL however have no solution for intel based machines.

I would additionally be interested in the active signal resolution vs desktop resolution field and how to retrieve these.

1

Roman R.
  • 68,205
  • 6
  • 94
  • 158
kaidoe
  • 79
  • 6
  • EnumDisplaySettings, use ENUM_CURRENT_SETTINGS to get the current configuration. That machine needs its disk reformatted. – Hans Passant Nov 16 '18 at 00:02
  • Unfortunately the win32 api calls do not report any 10 bit modes, instead reporting 32bpp in both 8 and 10-bit cases. DISPLAYCONFIG_PIXELFORMAT provides some clue when reporting DISPLAYCONFIG_PIXELFORMAT_NONGDI, then as with the accepted answer you can use IDXGIOutput6 to query the true mode. https://msdn.microsoft.com/ru-ru/office/ff553963(v=vs.90) – kaidoe Nov 17 '18 at 12:06

2 Answers2

2

DXGI_OUTPUT_DESC1 structure gets you that:

BitsPerColor

Type: UINT

The number of bits per color channel for the active wire format of the display attached to this output.

The DXGI_OUTPUT_DESC1 structure is initialized by the IDXGIOutput6::GetDesc1 method.

Just an example of what sort of data you get there:

--

Adapter: Radeon RX 570 Series

Output: \.\DISPLAY4
  • Desktop Coordinates: (0, 0) - (3840, 2160); 3840 x 2160
  • Attached To Desktop: 1
  • Rotation: DXGI_MODE_ROTATION_IDENTITY
  • Monitor: 0x000100AF
  • Physical Monitors: LG ULTRA HD(DisplayPort) (0x00000000)
  • Bits Per Color: 10 <<----------------------------------
  • Color Space: DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
  • Primaries, White Point: R { 0.652, 0.335 }, G { 0.305, 0.637 }, B { 0.148, 0.062 }; { 0.313, 0.329 }
  • Luminance: Min 0.500, Max 270.000, Max Full Frame 270.000
  • Hardware Composition Support: DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_FULLSCREEN | DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_CURSOR_STRETCHED

enter image description here

Roman R.
  • 68,205
  • 6
  • 94
  • 158
0

In my opinion, the Bit depth in advanced display settings actually means bit depth for each color, it's just a naming confusion. Standard 32 bit color is 8 bits each for red, green, blue, the remaining 8 bits are either used for transparency or are just filled with zeros. That's why you always get 32 bits for each pixel.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Baron
  • 48
  • 2