Decoding Images
With the BitmapDecoder
class in the Windows.Graphics.Imaging
namespace, you get access to the decoding process that occurs automatically when displaying image content in an Image
element. This enables you to do interesting things, such as getting the pixel data for an image file, or retrieving any metadata stored inside, such as tagged people.
To demonstrate BitmapDecoder
throughout this section, we’ll start with a method almost identical to the ShowUserSelectedFile
example from a previous FAQ sidebar:
async Task DecodeUserSelectedFile() { // Get a JPEG from the user FileOpenPicker picker = new FileOpenPicker(); picker.FileTypeFilter.Add(".jpg"); picker.FileTypeFilter.Add(".jpeg"); #if WINDOWS_PHONE_APP ...
Get Universal Windows® Apps with XAML and C# 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.