WP8仿真器屏幕尺寸 [英] WP8 Emulator screen size

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

问题描述

我已将WP7应用程序迁移到WP8平台.现在,如果我开始在WXGA Emulator中调试应用程序(屏幕大小应为768×1280).我有 Host.Content.ActualWidth = 480 Host.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视频,也不想在HD分辨率屏幕上拉伸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的行为@

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天全站免登陆