How to set resolution higher on Flex desktop native (Air) app?

柔情痞子 提交于 2019-12-23 10:29:09

问题


I'm trying to change the resolution for a flex native app (air) app running on a retina macbook. Flex apps in the browser render everything smoothly at 160dpi automatically but if I build the same app as Air install app, it renders at 72dpi and doesn't look as good. I know you can set a resolution in the application descriptor file for a mobile app but this isn't one. Also, I've tried setting the applicationDPI property on the WindowedApplication tag as well with no luck. Any ideas? Thanks...


回答1:


For the record, to enable high resolution rendering in AIR desktop apps running on e.g. Retina Macbook Pros, set <requestedDisplayResolution>high</requestedDisplayResolution> in the <initialWindow> part of your app descriptor XML. Requires Adobe AIR 3.6 or newer.

http://help.adobe.com/en_US/air/build/WSfffb011ac560372f2fea1812938a6e463-8000.html#WSfffb011ac560372f-4cb7055d12d779150e8-8000




回答2:


http://gregsramblings.com/2010/05/06/scaling-an-adobe-air-application-to-fit-multiple-resolutions-and-netbooks/

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml&quot; width="1019" height="680" scaleX="0.8" scaleY="0.8" applicationComplete="init()" ...>

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml&quot; width="1019" height="680" preinitialize="initScreenSize()" applicationComplete="init()" ...> ... ... private function initScreenSize():void{ var thisScreen:Screen = Screen.mainScreen; var newScaleX:Number = thisScreen.visibleBounds.width / 1019 * 0.98; var newScaleY:Number = thisScreen.visibleBounds.height / 680 * 0.98; var newScale:Number = Math.min(newScaleX,newScaleY,1); this.scaleX = newScale; this.scaleY = newScale; this.height = this.height * newScale; this.width = this.width * newScale; }

to scale the app based on the user’s resolution. Here’s the code:



来源:https://stackoverflow.com/questions/13592921/how-to-set-resolution-higher-on-flex-desktop-native-air-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!