Centimeter to pixel

前端 未结 6 1275
深忆病人
深忆病人 2021-01-11 18:55

How do I convert centimeter to pixel in c# ?

6条回答
  •  臣服心动
    2021-01-11 19:52

    Length in CM = LenghtPixels * 2.54 / DPI

    I think you can get the DPI of every display using WMI, the value you're searching for is in the class Win32_DisplayConfiguration, under the field LogPixe.

    Check this link about using WMI to retrieve data: LINK

提交回复
热议问题