简体   繁体   English

如何在Flex桌面本机(Air)应用程序上设置更高的分辨率?

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

I'm trying to change the resolution for a flex native app (air) app running on a retina macbook. 我正在尝试更改在视网膜macbook上运行的flex原生应用(空气)应用的分辨率。 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. 浏览器中的Flex应用程序会自动以160dpi平滑渲染所有内容,但如果我构建与Air安装应用程序相同的应用程序,则渲染为72dpi并且看起来不太好。 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. 另外,我已经尝试在WindowedApplication标签上设置applicationDPI属性,但没有运气。 Any ideas? 有任何想法吗? Thanks... 谢谢...

For the record, to enable high resolution rendering in AIR desktop apps running on eg Retina Macbook Pros, set <requestedDisplayResolution>high</requestedDisplayResolution> in the <initialWindow> part of your app descriptor XML. 为了记录,要在例如Retina Macbook Pros上运行的AIR桌面应用程序中启用高分辨率渲染, <requestedDisplayResolution>high</requestedDisplayResolution>在应用程序描述符XML的<initialWindow>部分中设置<requestedDisplayResolution>high</requestedDisplayResolution> Requires Adobe AIR 3.6 or newer. 需要Adobe AIR 3.6或更高版本。

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

http://gregsramblings.com/2010/05/06/scaling-an-adobe-air-application-to-fit-multiple-resolutions-and-netbooks/ 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“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; } <mx:WindowedApplication xmlns:mx =“ http://www.adobe.com/2006/mxml&quot ; width =”1019“height =”680“preinitialize =”initScreenSize()“applicationComplete =”init()“... > ...私有函数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: 这是代码:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM