Paket | mx.core |
Klass | public class RuntimeDPIProvider |
Arv | RuntimeDPIProvider Object |
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 4.5 |
Körningsmiljöversioner: | 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
.
Fler exempel
Relaterade API-element
Egenskap | Definieras med | ||
---|---|---|---|
constructor : Object
En referens till klassobjektet eller konstruktorfunktionen för en given objektinstans. | Object | ||
runtimeDPI : Number [skrivskyddad]
Returns the runtime DPI of the current device by mapping its
flash.system.Capabilities.screenDPI to one of several DPI
values in mx.core.DPIClassification. | RuntimeDPIProvider |
Metod | Definieras med | ||
---|---|---|---|
Constructor. | RuntimeDPIProvider | ||
Anger om det finns en egenskap angiven för ett objekt. | Object | ||
Anger om en instans av klassen Object finns i prototypkedjan för objektet som anges som parameter. | Object | ||
Anger om den angivna egenskapen finns och är uppräkningsbar. | Object | ||
Anger tillgänglighet för en dynamisk egenskap för slingåtgärder. | Object | ||
Returnerar det här objektets strängrepresentation, formaterad i enlighet med språkspecifika konventioner. | Object | ||
Returnerar det angivna objektets strängbeteckning. | Object | ||
Returnerar det angivna objektets primitiva värde. | Object |
runtimeDPI | egenskap |
runtimeDPI:Number
[skrivskyddad] Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 4.5 |
Körningsmiljöversioner: | Flash Player 10, AIR 2.5 |
Returns the runtime DPI of the current device by mapping its
flash.system.Capabilities.screenDPI
to one of several DPI
values in mx.core.DPIClassification
.
A number of devices can have slightly different DPI values and Flex maps these
into the several DPI classes.
Flex uses this method to calculate the current DPI value when an Application
authored for a specific DPI is adapted to the current one through scaling.
Implementering
public function get runtimeDPI():Number
Relaterade API-element
RuntimeDPIProvider | () | Konstruktor |
public function RuntimeDPIProvider()
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 4.5 |
Körningsmiljöversioner: | Flash Player 10, AIR 2.5 |
Constructor.
<?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>
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; } } }
Tue Jun 12 2018, 01:40 PM Z