Share via


BitmapEncoder.CreateForTranscodingAsync Method

Definition

Asynchronously creates a new BitmapEncoder and initializes it using data from an existing 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)

Parameters

stream
IRandomAccessStream

The output stream.

bitmapDecoder
BitmapDecoder

A BitmapDecoder containing the image data to be copied.

Returns

An object that manages the asynchronous creation of a new BitmapEncoder using data from an existing BitmapDecoder.

Attributes

Remarks

Call this method when you want to edit some elements in an image but want to preserve the rest of the data intact. For example, if you want to write some metadata or properties but don't want to touch the image itself. When you create a BitmapEncoder using this method, it is initialized using data from the bitmapDecoder argument. Any data that you set on the encoder will overwrite the existing data, and all other data is preserved unchanged.

This method only allows you to create an encoder of the same image format as the decoder.

Applies to

See also