Centimeter to pixel

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

How do I convert centimeter to pixel in c# ?

6条回答
  •  隐瞒了意图╮
    2021-01-11 19:47

    Pixel and centimeter are two different Units they are calculated according to the User's DPI setting. To convert correctly you need to know the DPI of the User Screen.

    If you have a 12.8 centimeter display showing a 1280x1024 image, then you have 100 pixels per centimeter.

    However you can try using the Graphics.TransformPoints to convert from pixel to cm or opposite.

提交回复
热议问题