Share via


BitmapEncoder.CreateForTranscodingAsync 方法

定義

以非同步方式建立新的 BitmapEncoder ,並使用來自現有 BitmapDecoder的資料加以初始化。

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

參數

stream
IRandomAccessStream

輸出資料流。

bitmapDecoder
BitmapDecoder

BitmapDecoder,其中包含要複製的影像資料。

傳回

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

屬性

備註

當您想要編輯影像中的某些元素,但想要保留其餘的資料時,請呼叫此方法。 例如,如果您想要撰寫某些中繼資料或屬性,但不想觸控影像本身。 當您使用此方法建立 BitmapEncoder 時,會使用 bitmapDecoder 引數中的資料初始化。 您在編碼器上設定的任何資料都會覆寫現有的資料,所有其他資料都會保持不變。

這個方法只允許您建立與解碼器相同的影像格式編碼器。

適用於

另請參閱