可以用来测显示屏的inch数。

foreach (Screen scr_loopVariable in Screen.AllScreens)

{

Screen scr = scr_loopVariable;

double height = scr.Bounds.Height / this.CreateGraphics().DpiY;

double size = Math.Sqrt((width * width) + (height*height));

Debug.WriteLine(string.Format("Screen {0} is Size {1:0.00} inches", scr.DeviceName, size));

}
原文地址:https://www.cnblogs.com/tony-MSDN/p/4368009.html