C#中如何获取屏幕大小(以毫米算)
C#中如何获取屏幕大小(以毫米算),多谢 --------------------编程问答-------------------- Screen screen = Screen.PrimaryScreen;int a = screen.Bounds.Width ; //宽
int b = screen.Bounds.Height; //高
比如我的显示器,计算完的结果是1024和768,
单位为像素。像素与毫米的转换根据显示器的不同而不同。
参考:
http://topic.csdn.net/t/20041025/00/3486895.html --------------------编程问答-------------------- public PointF MMConv(Graphics AGraphic, PointF APoint)
{
if (AGraphic == null) return PointF.Empty;
APoint.X *= AGraphic.DpiX / 25.4f;
APoint.Y *= AGraphic.DpiY / 25.4f;
return APoint;
}
Console.WriteLine(MMConv(Graphics.FromHwnd(Handle), new Point(100, 100))); --------------------编程问答--------------------
UP --------------------编程问答--------------------
很简单
补充:.NET技术 , C#