| パッケージ | mx.core |
| クラス | public class RuntimeDPIProvider |
| 継承 | RuntimeDPIProvider Object |
| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4.5 |
| ランタイムバージョン: | Flash Player 10, AIR 2.5 |
Flex のデフォルトマッピングのオーバーライドは通常、screenDPI を正しく報告しないデバイスや、他の DPI クラスを使用したほうが拡大 / 縮小がうまくいくデバイスでのみ必要になります。
Flex のデフォルトマッピングは次のとおりです。
| 160 DPI | <200 DPI |
| 240 DPI | >=200 DPI および <280 DPI |
| 320 DPI | >=280 DPI |
RuntimeDPIProvider のサブクラスはランタイム API にのみ依存しているべきであり、mx.core.DPIClassification を除く、Flex フレームワークに特有のクラスには依存できません。
関連する API エレメント
パブリックプロパティ
| プロパティ | 定義元 | ||
|---|---|---|---|
![]() | constructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。 | Object | |
| runtimeDPI : Number [読み取り専用]
現在のデバイスの flash.system.Capabilities.screenDPI を mx.core.DPIClassification のいずれかの DPI 値にマッピングして、デバイスのランタイム DPI を返します。 | RuntimeDPIProvider | ||
パブリックメソッド
| メソッド | 定義元 | ||
|---|---|---|---|
コンストラクターです。 | RuntimeDPIProvider | ||
![]() |
オブジェクトに指定されたプロパティが定義されているかどうかを示します。 | Object | |
![]() |
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。 | Object | |
![]() |
指定されたプロパティが存在し、列挙できるかどうかを示します。 | Object | |
![]() |
ループ処理に対するダイナミックプロパティの可用性を設定します。 | Object | |
![]() |
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのプリミティブな値を返します。 | Object | |
プロパティの詳細
runtimeDPI | プロパティ |
runtimeDPI:Number [読み取り専用] | 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4.5 |
| ランタイムバージョン: | Flash Player 10, AIR 2.5 |
現在のデバイスの flash.system.Capabilities.screenDPI を mx.core.DPIClassification の DPI 値のいずれかにマッピングして、デバイスのランタイム DPI を返します。多数のデバイスの DPI 値が微妙に異なることがあるため、Flex ではこれらの値をいくつかの DPI クラスにマッピングします。特定の DPI 向けに作成されたアプリケーションを拡大 / 縮小によって現在の DPI に対応させる際、Flex はこの方法で現在の DPI 値を計算します。
実装
public function get runtimeDPI():Number関連する API エレメント
コンストラクターの詳細
RuntimeDPIProvider | () | コンストラクター |
public function RuntimeDPIProvider()| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4.5 |
| ランタイムバージョン: | Flash Player 10, AIR 2.5 |
コンストラクターです。
例 この例の使用方法
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
Tue Jun 12 2018, 10:34 AM Z
継承されるパブリックプロパティを隠す
継承されるパブリックプロパティを表示