O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transcoding

Transcoding refers to the conversion of data from one encoding to another. So far, the encoding examples have created a new image (the silly gradient-filled image), but you can transcode an existing image by obtaining its current data via BitmapDecoder, feeding it into BitmapEncoder, and then changing it however you see fit.

You could do this by manually copying all pixel data and metadata obtained from the decoder over to the encoder, but BitmapEncoder has a nice shortcut for this scenario. Rather than creating a BitmapEncoder with its CreateAsync method, you can create one with its CreateForTranscodingAsync method. You simply give it the instance of the IRandomAccessStream that was given to a BitmapDecoder and the BitmapDecoder ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required