可以用来测显示屏的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));

}

 

posted @ 2015-03-26 11:03  Youjun  阅读(152)  评论(0编辑  收藏  举报