标签:
之前看了下网上,分辨率都是用webview js拿或者全屏拿宽高,很有局限性。
研究一下。找到个完美的方法:
public Size GetDeviceResolution() { Size resolution = Size.Empty; var rawPixelsPerViewPixel = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel; foreach (var item in PointerDevice.GetPointerDevices()) { resolution.Width = item.ScreenRect.Width * rawPixelsPerViewPixel; resolution.Height = item.ScreenRect.Height * rawPixelsPerViewPixel; break; } return resolution; }
完美规避各种不方便
标签:
原文地址:http://www.cnblogs.com/FaDeKongJian/p/5534323.html