Encoding Images

The opposite of BitmapDecoder is a BitmapEncoder class from the same namespace. With it, Windows Store and universal apps can create and modify images, and then save them to multiple formats. You can also write metadata values, if the target format supports it.

BitmapEncoder exposes an API that’s similar to BitmapDecoder, or at least as similar as possible considering the different requirements of the task. BitmapEncoder’s CreateAsync method forces you to choose which encoder (and therefore which codec) to use by passing in a Guid identifying it in addition to the IRandomAccessStream. As with BitmapDecoder, BitmapEncoder exposes several public static Guid properties for the built-in BMP, GIF, JPEG, JPEG-XR, PNG, and TIFF encoders. ...

Get XAML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.