我正在开发Windows 8.1应用程序,目前我正在努力获取以英寸为单位的实际屏幕尺寸或任何其他测量单位。
是否可以获取该信息?
答案 0 :(得分:0)
var bounds = Window.Current.Bounds;
double w = bounds.Width;
double h = bounds.Height;
switch (DisplayProperties.ResolutionScale)
{
case ResolutionScale.Scale140Percent:
w = Math.Ceiling(w * 1.4);
h = Math.Ceiling(h * 1.4);
break;
case ResolutionScale.Scale180Percent:
w = Math.Ceiling(w * 1.8);
h = Math.Ceiling(h * 1.8);
break;
}
Size resolution = new Size(w, h);