How to obtain the correct physical size of the monitor?

后端 未结 7 1355
闹比i
闹比i 2020-12-01 10:13

How can I get the size of the display in centimeters or inches?

This code does not always works correctly:

HDC hdc = CreateDC(_T(\"DISPLAY\"),dd.Devi         


        
7条回答
  •  死守一世寂寞
    2020-12-01 10:43

    It is not possible to determine the exact physical size of a video device on windows as this depends on quite a lot of variables (e.g. active monitor profile, horizontal/vertical resolution, pixel size, etc.), some of which are not under the control of the computer.

    Think for example of projector devices, where the physical size depends on the distance to the projection area which cannot be determined programmatically, as the video projector could be moved manually anytime.

提交回复
热议问题