BitmapEncoder.CreateAsync Method

Definition

Overloads

CreateAsync(Guid, IRandomAccessStream)

Asynchronously creates a new BitmapEncoder.

CreateAsync(Guid, IRandomAccessStream, IEnumerable<KeyValuePair<String,BitmapTypedValue>>)

Asynchronously creates a new BitmapEncoder for the specified codec with the specified encoding options and initializes it on a stream.

CreateAsync(Guid, IRandomAccessStream)

Asynchronously creates a new BitmapEncoder.

[Windows.Foundation.Metadata.Overload("CreateAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<BitmapEncoder> CreateAsync(Guid encoderId, IRandomAccessStream stream);
function createAsync(encoderId, stream)
Public Shared Function CreateAsync (encoderId As Guid, stream As IRandomAccessStream) As IAsyncOperation(Of BitmapEncoder)

Parameters

encoderId
Guid

The unique identifier of the specified encoder.

stream
IRandomAccessStream

The output stream.

Returns

IAsyncOperation<BitmapEncoder>

An object that manages the asynchronous creation of a new BitmapEncoder.

Attributes

Remarks

An application must always specify the encoderId in order to create a BitmapEncoder. The unique identifiers of the built-in encoders are available as properties on BitmapEncoder. In addition, the unique identifier of any installed encoder can be obtained by using the GetEncoderInformationEnumerator method.

BitmapEncoder expects that the output stream is empty. You can ensure that the stream is empty by setting its Size property to 0.

See also

Applies to

CreateAsync(Guid, IRandomAccessStream, IEnumerable<KeyValuePair<String,BitmapTypedValue>>)

Asynchronously creates a new BitmapEncoder for the specified codec with the specified encoding options and initializes it on a stream.

[Windows.Foundation.Metadata.Overload("CreateWithEncodingOptionsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<BitmapEncoder> CreateAsync(Guid encoderId, IRandomAccessStream stream, IEnumerable<KeyValuePair<string,BitmapTypedValue>> encodingOptions);
function createAsync(encoderId, stream, encodingOptions)
Public Shared Function CreateAsync (encoderId As Guid, stream As IRandomAccessStream, encodingOptions As IEnumerable(Of KeyValuePair(Of String, BitmapTypedValue))) As IAsyncOperation(Of BitmapEncoder)

Parameters

encoderId
Guid

The unique identifier of the specified encoder.

stream
IRandomAccessStream

A stream representing where the image file is to be written.

encodingOptions
IEnumerable<KeyValuePair<String,BitmapTypedValue>>

A collection of key-value pairs containing one or more codec-specific encoding options and the desired values.

Returns

IAsyncOperation<BitmapEncoder>

An object that manages the asynchronous creation of a new BitmapEncoder.

Attributes

See also

Applies to