BitmapEncoder.CreateAsync(Guid, IRandomAccessStream, IIterable(IKeyValuePair)) | createAsync(Guid, IRandomAccessStream, IIterable(IKeyValuePair)) method

Applies to Windows and Windows Phone

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

Syntax


Windows.Graphics.Imaging.BitmapEncoder.createAsync(encoderId, stream, encodingOptions).done( /* Your success and error handlers */ );

Parameters

encoderId

Type: String [JavaScript] | System.Guid [.NET] | Platform::Guid [C++]

The unique identifier of the specified encoder.

stream

Type: IRandomAccessStream

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

encodingOptions

Type: IIterable<IKeyValuePair> [JavaScript/C++] | System.Collections.Generic.IEnumerable<IKeyValuePair> [.NET]

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

Return value

Type: IAsyncOperation<BitmapEncoder>

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

Remarks

Unlike with BitmapDecoder, 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.

Bitmap encoders may expose various encoding options that affect the quality, size and other properties of the encoded output file. For more info, see How to use encoding options.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Graphics.Imaging
Windows::Graphics::Imaging [C++]

Metadata

Windows.winmd

See also

BitmapEncoder
BitmapPropertySet
BitmapTypedValue
How to use encoding options
CreateAsync(Guid, IRandomAccessStream)

 

 

Show:
© 2014 Microsoft