WP8 模拟器屏幕尺寸 [英] WP8 Emulator screen size

查看:25
本文介绍了WP8 模拟器屏幕尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将我的 WP7 应用程序迁移到 WP8 平台.现在,如果我开始在 WXGA Emulator 中调试我的应用程序(屏幕尺寸应为 768 × 1280).我有Host.Content.ActualWidth=480Host.Content.ActualHeight=800.

I have migrate my WP7 application to WP8 platform. Now, if I start debugging my application in WXGA Emulator (screen size should be 768 × 1280). I have got Host.Content.ActualWidth=480 and Host.Content.ActualHeight=800.

这是正常行为吗?为什么 WXGA 模拟器的屏幕尺寸为 480x800?

Is it normal behaviour? Why WXGA emulator have screen size 480x800?

推荐答案

是的,这就是 WP8 应该工作的方式.

Yeah, that's how WP8 should work.

WP8 多分辨率的禅意就是让开发者做尽可能少的工作来解决不同分辨率的问题.其他平台放弃了开发人员的所有辛勤工作,以将物理像素用于不同的分辨率.相反,WP8 使用 480x800 和 480x853 的逻辑像素来解决不同的分辨率.

The zen of WP8 multi-resolution is to make developers to do as little work as possible to account for different resolutions. Other platforms dump all the hard work on developers to use physical pixels for different resolutions. Instead WP8 uses logical pixels of 480x800 and 480x853 to account for different resolutions.

应用开发者真的只需要做两件事.首先是使用 Grid 相关设计(而不是 Canvas 绝对设计)来帮助 480x853 逻辑分辨率.其次是确保使用适用于不同分辨率的媒体资产.例如,您不想在低分辨率屏幕上播放 720p 视频,也不想在高清分辨率屏幕上拉伸 240 像素宽的图像.

App developers really need to only do two things. First is to use Grid relative design (and not Canvas absolute design) to help with the 480x853 logical resolution. Second is to make sure to use media assets that work well for different resolutions. For example, you don't want to play a 720p video on a low-res screens, and you don't want to stretch a 240 pixels wide image on an HD resolution screen.

我写了很多关于这个主题的文章,包括代码示例以及相关 API 的行为方式@http://www.developer.nokia.com/Community/Wiki/What%27s_new_in_Windows_Phone_8#Multi_resolution

I wrote about this topic extensively including code samples and how the relevant APIs behave @ http://www.developer.nokia.com/Community/Wiki/What%27s_new_in_Windows_Phone_8#Multi_resolution

这篇关于WP8 模拟器屏幕尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆