5
votes

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...

2
Instead of trying to set it; what happens if you run an app w/o it being set? What is the value then? - JeffryHouser
@www.Flextras.com If I remember the Adobe docs correctly, they automatically choose 160dpi for all desktop apps. I believe they don't even run check what the DPI truly is before setting it. - Josh
@Apocalyptic0n3 Interesting for sure. If it's a Flex Framework thing; then Application may be able to be extended modified. If it's a runtime thing; then you may have to wait for a runtime update... - JeffryHouser
Thanks, really appreciate the responses - If I run it without it being set it says 160. If I actually set applicationDPI to 160 there is no change, 320 - it renders everything 1/2 the size but still blurry. I can understand they don't check what the DPI is before setting it but I find it odd that the web version renders differently (and really, really nice). - user1751035

2 Answers

2
votes

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

0
votes

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: