0

没有获取屏幕分辨率winrt的副本

以上在 C# 等中是可能的,但在 JavaScript 中是不可能的。

那么如何在 JavaScript WinRT 应用程序中获得屏幕分辨率?

4

1 回答 1

2

One way is to use the window object and get the width and height:

var width = window.outerWidth;
var height = window.outerHeight;

Keep in mind that, while the WinJS stuff in WinRT apps doesn't translate back to the web browser platform, anything on the web browser platform should translate directly into WinRT apps. So any approach for getting the window's dimensions in a browser should work in the WinRT app as well.

于 2013-06-28T13:11:05.647 回答