語言

PackageManager.GetDrawable(String, Int32, ApplicationInfo) 方法

定義

從套件中擷取一張圖片。

[Android.Runtime.Register("getDrawable", "(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_Ljava_lang_String_ILandroid_content_pm_ApplicationInfo_Handler")]
public abstract Android.Graphics.Drawables.Drawable? GetDrawable(string packageName, int resid, Android.Content.PM.ApplicationInfo? appInfo);
[<Android.Runtime.Register("getDrawable", "(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_Ljava_lang_String_ILandroid_content_pm_ApplicationInfo_Handler")>]
abstract member GetDrawable : string * int * Android.Content.PM.ApplicationInfo -> Android.Graphics.Drawables.Drawable

參數

packageName
String

這個圖示來自的包裹名稱。 不可為空值。

resid
Int32

目標影像的資源識別碼。 不可能是0。

appInfo
ApplicationInfo

關於 <var>packageName</var> 的整體資訊。 這可能是空的,若需要,應用程式資訊會自動幫你取得;如果你已經有這些資訊,提供這裡會更有效率。

傳回

回傳一個可繪製的圖,裡面有被要求的圖片。 若因任何原因找不到影像,則回傳為空。

屬性

備註

從套件中擷取一張圖片。 這是一個由各種套件管理器資訊結構使用的低階 API(例如 ComponentInfo 實作其相關圖示的擷取)。

Java 文件 android.content.pm.PackageManager.getDrawable(java.lang.String, int, android.content.pm.ApplicationInfo)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於