BitmapEncoder.CreateForInPlacePropertyEncodingAsync(BitmapDecoder) 方法

定義

以非同步方式建立新的 BitmapEncoder 以進行就地屬性和中繼資料編輯。 新的編碼器只能就地編輯點陣圖屬性,而且任何其他用途都會失敗。

public:
 static IAsyncOperation<BitmapEncoder ^> ^ CreateForInPlacePropertyEncodingAsync(BitmapDecoder ^ bitmapDecoder);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<BitmapEncoder> CreateForInPlacePropertyEncodingAsync(BitmapDecoder const& bitmapDecoder);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<BitmapEncoder> CreateForInPlacePropertyEncodingAsync(BitmapDecoder bitmapDecoder);
function createForInPlacePropertyEncodingAsync(bitmapDecoder)
Public Shared Function CreateForInPlacePropertyEncodingAsync (bitmapDecoder As BitmapDecoder) As IAsyncOperation(Of BitmapEncoder)

參數

bitmapDecoder
BitmapDecoder

BitmapDecoder,其中包含要編輯的影像資料。 此參數必須在具有 ReadWrite存取模式的資料流程上建立。

注意

編碼器會寫入原始 BitmapDecoder 建立所在的資料流程。 您無法指定輸出資料流程。

傳回

物件,使用現有BitmapDecoder 的資料來管理新 BitmapEncoder的非同步初始化。

屬性

備註

當您只將它用來編輯或將有限數量的屬性寫入影像時,請使用此方法來擷取編碼器。 透過這種方式擷取的編碼器,可以透過 CreateForTranscodingAsync 傳回的編碼器提供效能優勢,因為它會將新的屬性寫入空白填補空間,而不是再次編碼整個影像。

以下是以這種方式擷取編碼器的數個限制:

  • 您只能在編碼器上使用這些方法:
  • 輸入 BitmapDecoder 必須是在具有 ReadWrite 存取權的資料流程上建立的編碼器。
  • 並非所有元資料格式都支援快速的中繼資料編碼。 支援中繼資料的原生元資料處理程式為 IFD、Exif、XMP 和 GPS。
  • 中繼資料區塊必須有足夠的填補,才能儲存您嘗試編輯的屬性。 如果編碼作業因故失敗,您必須使用 CreateForTranscodingAsync 來編輯中繼資料並重新編碼影像。 當您重新編碼時,也可以加入新的或其他填補,以在未來啟用就地屬性編碼。 若要這樣做,請建立新的 BitmapTypedValue ,並將 Type 設定為 UInt32,並將 Value 設定為您想要新增的填補位元組數目。 一般值為 4096 個位元組。 在此資料表的一或多個中繼資料查詢位置上設定此中繼資料專案。
    中繼資料格式JPEG 中繼資料查詢TIFF、JPEG-XR 中繼資料查詢
    IFD/app1/ifd/PaddingSchema:Padding/ifd/PaddingSchema:Padding
    Exif/app1/ifd/exif/PaddingSchema:Padding/ifd/exif/PaddingSchema:Padding
    XMP/xmp/PaddingSchema:Padding/ifd/xmp/PaddingSchema:Padding
    GPS/app1/ifd/gps/PaddingSchema:Padding/ifd/gps/PaddingSchema:Padding

適用於