Question

I read that screen dpi resolutions above 320 are not supported in Flex but according to this article it should be possible to create a custom implementation. So for test purposes I added these two lines with apache flex 4.10

applicationDPI="320"
runtimeDPIProvider="DPITestClass"

and created the DPITestClass containing this

override public function get runtimeDPI() : Number
{
    return 3200;
}

As far as I understood this should scale all pixel parameters by 10 on each device but instead it does absolutely nothing. It still scales the pixels depending on the device dpi - just like the runtimeDPIProvider isn't set (except if I log runtimeDPI in my main class it says '3200').

Is that because higher dpi are still not supported in general and this extension get's blocked somewhere within the flex framework or did I do something wrong?

Was it helpful?

Solution

You can override the runtimeDPI method to return one on the DPIClassification constants which represents a range of dpis (eg DPI_160, DPI_240 or DPI_360). It is usually used to correct devices that report the wrong runtime dpi.

Flex does support higher than 320 dpi. It just puts the application into the 320 dpi bucket when using Apache Flex 4.9 and lower. Apache Flex 4.10 added support for a 480 dpi bucket and Apache Flex 4.11 will add support for both a 120 and 640 dpi bucket. Each dpi bucket is optimised for a dpi range but on application will not stop working if it has a different or higher dpi.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top