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
屬性值
列舉的一個數值。 預設是物理。
備註
DecodePixelType 可以設定為 邏輯 或 物理。 預設數值是物理。 如果 DecodePixelType 未設定或未設為 Physical,則影像會使用 DecodePixelWidth 和 DecodePixelHeight 的值來解碼,這兩個值代表實體像素,解碼操作會直接使用這些值。 若 DecodePixelType 設為 邏輯,則使用 DecodePixelWidth 與 DecodePixelHeight 值解碼,這些值代表邏輯像素。 內部邏輯會根據裝置解析度資訊,以及邏輯與物理像素在目標裝置上的因式分解,轉換解碼寬度與高度。
影像元素的寬度與高度會在影像渲染後以邏輯像素表示,但這些邏輯像素會受到裝置解析度的影響。 對於代表影像檔案來源的 BitmapImage 元素, DecodePixelWidth 和 DecodePixelHeight 預設以實體像素為單位。 解碼操作所提供的實體像素值會影響記憶體中建立的點陣圖大小。 將 DecodePixelType 指定為 邏輯,影像會使用預先為邏輯解析度分解的值解碼,且可能不會使用較多記憶體。 欲了解更多裝置解析度與影像來源資訊,請參閱 有效像素與縮放。