Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BitmapEncoder.CreateForTranscodingAsync | createForTranscodingAsync method

Asynchronously creates a new BitmapEncoder and initializes it using data from an existing BitmapDecoder.

Syntax


Windows.Graphics.Imaging.BitmapEncoder.createForTranscodingAsync(stream, bitmapDecoder).done( /* Your success and error handlers */ );

Parameters

stream

Type: IRandomAccessStream

The output stream.

bitmapDecoder

Type: BitmapDecoder

A BitmapDecoder containing the image data to be copied.

Return value

Type: IAsyncOperation<BitmapEncoder>

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

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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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
Imaging

 

 

Show: