Language

Resources.GetDrawableForDensity メソッド

定義

オーバーロード

名前 説明
GetDrawableForDensity(Int32, Int32)
古い.

指定された画面密度の特定のリソース ID に関連付けられた描画可能なオブジェクトを DPI で返します。

GetDrawableForDensity(Int32, Int32, Resources+Theme)

指定された画面密度の特定のリソース ID に関連付けられた描画可能なオブジェクトを DPI で返します。

GetDrawableForDensity(Int32, Int32)

注意事項

deprecated

指定された画面密度の特定のリソース ID に関連付けられた描画可能なオブジェクトを DPI で返します。

[Android.Runtime.Register("getDrawableForDensity", "(II)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_IIHandler")]
[System.Obsolete("deprecated")]
public virtual Android.Graphics.Drawables.Drawable? GetDrawableForDensity(int id, int density);
[<Android.Runtime.Register("getDrawableForDensity", "(II)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_IIHandler")>]
[<System.Obsolete("deprecated")>]
abstract member GetDrawableForDensity : int * int -> Android.Graphics.Drawables.Drawable
override this.GetDrawableForDensity : int * int -> Android.Graphics.Drawables.Drawable

パラメーター

id
Int32

aapt ツールによって生成される目的のリソース識別子。 この整数は、パッケージ、型、およびリソース エントリをエンコードします。 値 0 は無効な識別子です。

density
Int32

DisplayMetricsで見つかったリソースによって示される目的の画面密度。 値 0 は、 #getConfiguration()から返される密度を使用することを意味します。 これは、 #getDrawable(int)を呼び出すことと同じです。

返品

Drawable このリソースの描画に使用できるオブジェクト。

属性

例外

指定された ID が存在しない場合は、NotFoundException をスローします。

注釈

指定された画面密度の特定のリソース ID に関連付けられた描画可能なオブジェクトを DPI で返します。 これにより、描画可能な密度がデバイスの密度に実際の描画可能密度と要求された密度の比率を乗算するように設定されます。 これにより、必要に応じて、描画可能な描画可能なサイズを適切なサイズにスケールアップできます。 基になるリソース (純色、PNG イメージ、スケーラブルなイメージなど) に応じて、さまざまな種類のオブジェクトが返されます。Drawable API は、これらの実装の詳細を非表示にします。

<strong>Note:</strong> テーマの描画可能な描画を取得するには、 android.content.Context#getDrawable(int) Context.getDrawable(int) を使用するか、目的のテーマを渡 #getDrawableForDensity(int, int, Theme) します。

このメンバーは非推奨です。 #getDrawableForDensity(int, int, Theme) を代わりに使用します。

Javaドキュメント。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

こちらもご覧ください

  • <xref:Android.Content.Res.Resources.GetDrawableForDensity(System.Int32%2c+System.Int32%2c+System.Int32)>

適用対象

GetDrawableForDensity(Int32, Int32, Resources+Theme)

指定された画面密度の特定のリソース ID に関連付けられた描画可能なオブジェクトを DPI で返します。

[Android.Runtime.Register("getDrawableForDensity", "(IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_IILandroid_content_res_Resources_Theme_Handler")]
public virtual Android.Graphics.Drawables.Drawable? GetDrawableForDensity(int id, int density, Android.Content.Res.Resources.Theme? theme);
[<Android.Runtime.Register("getDrawableForDensity", "(IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_IILandroid_content_res_Resources_Theme_Handler")>]
abstract member GetDrawableForDensity : int * int * Android.Content.Res.Resources.Theme -> Android.Graphics.Drawables.Drawable
override this.GetDrawableForDensity : int * int * Android.Content.Res.Resources.Theme -> Android.Graphics.Drawables.Drawable

パラメーター

id
Int32

aapt ツールによって生成される目的のリソース識別子。 この整数は、パッケージ、型、およびリソース エントリをエンコードします。 値 0 は無効な識別子です。

density
Int32

DisplayMetricsで見つかったリソースによって示される目的の画面密度。 値 0 は、 #getConfiguration()から返される密度を使用することを意味します。 これは、 #getDrawable(int)を呼び出すことと同じです。

theme
Resources.Theme

描画可能な属性のスタイルを設定するために使用されるテーマは、 nullできます。

返品

Drawable このリソースの描画に使用できるオブジェクト。

属性

例外

指定された ID が存在しない場合は、NotFoundException をスローします。

注釈

Javaドキュメント。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象