BitmapImage.DecodePixelType 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,決定解碼作業的 DecodePixelWidth 和 DecodePixelHeight 值如何解譯。
public:
property DecodePixelType DecodePixelType { DecodePixelType get(); void set(DecodePixelType value); };
DecodePixelType DecodePixelType();
void DecodePixelType(DecodePixelType value);
public DecodePixelType DecodePixelType { get; set; }
var decodePixelType = bitmapImage.decodePixelType;
bitmapImage.decodePixelType = decodePixelType;
Public Property DecodePixelType As DecodePixelType
屬性值
列舉值。 預設值為 Physical。
備註
DecodePixelType 可以設定為 Logical 或 Physical。 預設值為 Physical。 如果未設定 DecodePixelType 或設定為 Physical,則會使用 DecodePixelWidth 和 DecodePixelHeight 值來解碼影像,而解碼作業會直接使用這些值。 如果 DecodePixelType 設定為 Logical,則會使用 DecodePixelWidth 和代表邏輯圖元 的 DecodePixelHeight 值來解碼影像。 內部邏輯會根據裝置解析度資訊,以及邏輯和實體圖元在目標裝置上的分解方式,轉換解碼寬度和高度。
一旦轉譯影像,影像就會以邏輯圖元指定Image元素的寬度和高度,但這些邏輯圖元會受到裝置解析度的影響。 針對代表影像檔來源的 BitmapImage 元素,預設會以實體圖元指定 DecodePixelWidth 和 DecodePixelHeight 。 為解碼作業提供的實體圖元值會影響記憶體中建立的點陣圖大小。 藉由將 DecodePixelType 指定為 Logical,影像會使用預先納入邏輯解析的因數值來解碼,而且可能不會使用太多記憶體。 如需裝置解析度和影像來源的詳細資訊,請參閱 有效圖元和縮放比例。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應