(Preview)
Package | mx.core |
Class | public class RuntimeDPIProvider |
Inheritance | RuntimeDPIProvider ![]() |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 4.5 |
Runtime Versions: | Flash Player 10, AIR 2.5 |
Overriding Flex's default mappings is usually only necessary for devices that incorrectly report their screenDPI and for devices that may scale better in a different DPI class.
Flex's default mappings are:
160 DPI | <200 DPI |
240 DPI | >=200 DPI and <280 DPI |
320 DPI | >=280 DPI |
Subclasses of RuntimeDPIProvider should only depend on runtime APIs
and should not depend on any classes specific to the Flex framework except
mx.core.DPIClassification
.
More examples
Related API Elements
Public Properties
Property | Defined By | ||
---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance. | Object |
Public Methods
Method | Defined By | ||
---|---|---|---|
![]() |
Indicates whether an object has a specified property defined. | Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | |
![]() |
Indicates whether the specified property exists and is enumerable. | Object | |
![]() |
Sets the availability of a dynamic property for loop operations. | Object | |
![]() |
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | |
![]() |
Returns the string representation of the specified object. | Object | |
![]() |
Returns the primitive value of the specified object. | Object |
Property Detail
Constructor Detail
Examples How to use this example
RuntimeDPIProviderApp.mxml
<?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.RuntimeDPIProviderAppView" applicationDPI="160" runtimeDPIProvider="RuntimeDPIProviderExample" > <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> </s:ViewNavigatorApplication>
RuntimeDPIProviderExample.as
package { import flash.system.Capabilities; import mx.core.DPIClassification; import mx.core.RuntimeDPIProvider; public class RuntimeDPIProviderExample extends RuntimeDPIProvider { public function RuntimeDPIProviderExample() { } override public function get runtimeDPI():Number { // A tablet reporting an incorrect DPI of 240. if (Capabilities.screenDPI == 240 && Capabilities.screenResolutionX == 600 && Capabilities.screenResolutionY == 1024) { return DPIClassification.DPI_160; } return super.runtimeDPI; } } }
RuntimeDPIProviderAppView.mxml
Wed Nov 21 2018, 06:34 AM -08:00