0

我正在开发 Windows 8.1 应用程序,目前我正在努力获取以英寸或任何其他测量单位为单位的实际屏幕尺寸。

是否有可能获得该信息?

4

1 回答 1

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);

答案取自此处:链接 和此处:链接

于 2015-10-30T09:48:01.567 回答