Icon.ExtractIcon 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| ExtractIcon(String, Int32, Boolean) |
從給定 |
| ExtractIcon(String, Int32, Int32) |
從給定 |
ExtractIcon(String, Int32, Boolean)
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
從給定 filePath的 中提取指定的圖示。
public static System.Drawing.Icon? ExtractIcon(string filePath, int id, bool smallIcon = false);
static member ExtractIcon : string * int * bool -> System.Drawing.Icon
Public Shared Function ExtractIcon (filePath As String, id As Integer, Optional smallIcon As Boolean = false) As Icon
參數
- filePath
- String
路徑指向圖示或 PE(.dll, .exe)檔案。
- id
- Int32
正數指的是該檔案中的圖示索引。 負數指的是 PE(.dll, .exe)檔案中特定的原生資源識別碼。
傳回
一個 Icon,或者 null 如果找不到帶有指定 id的圖示。
適用於
ExtractIcon(String, Int32, Int32)
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
- 來源:
- Icon.cs
從給定 filePath的 中提取指定的圖示。
public:
static System::Drawing::Icon ^ ExtractIcon(System::String ^ filePath, int id, int size);
public static System.Drawing.Icon? ExtractIcon(string filePath, int id, int size);
static member ExtractIcon : string * int * int -> System.Drawing.Icon
Public Shared Function ExtractIcon (filePath As String, id As Integer, size As Integer) As Icon
參數
- filePath
- String
路徑指向圖示或 PE(.dll, .exe)檔案。
- id
- Int32
正數指的是該檔案中的圖示索引。 負數指的是 PE(.dll, .exe)檔案中特定的原生資源識別碼。
- size
- Int32
想要的尺寸。 若不存在指定的大小,則會重新取樣現有大小以得到所要求的大小。
傳回
一個 Icon,或者 null 如果找不到帶有指定 id的圖示。
例外狀況
size 為負數或大於 MaxValue。
filePath 無法存取。
filePath 是 null。
備註
與 不同 Icon,此方法及 ExtractAssociatedIcon(String) 方法不會保留所有資源資料或修改原始資料(必要時調整大小)。 因此,它 Icon 只會使用所需大小所需的記憶體(主要是原生記憶體)。
沒有原始來源資料,他們 Icon 必須重新取樣當前圖示的點陣圖來改變大小。 為了最佳影像品質,如果想要不同大小的 a Icon ,應該用這個方法建立獨立實例,避免使用複製構造子。