如何在 Windows 8 Metro 应用程序中获取窗口的尺寸?
我想用画布元素填充屏幕,目前我的default.js
文件看起来像这样
// ... some autogenerated code ...
app.onactivated = function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
// ... some autogenerated code ...
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
canvas.width = 600; // I want to set width and height here so that
canvas.height = 800; // canvas fills the entire screen/window.
};
// ... more autogenerated code ...