BitmapDecoder BitmapDecoder BitmapDecoder BitmapDecoder BitmapDecoder Class

Definition

Provides read access to bitmap container data as well as data from the first frame.

public : sealed class BitmapDecoder : IBitmapDecoder, IBitmapFrame, IBitmapFrameWithSoftwareBitmap
struct winrt::Windows::Graphics::Imaging::BitmapDecoder : IBitmapDecoder, IBitmapFrame, IBitmapFrameWithSoftwareBitmap
public sealed class BitmapDecoder : IBitmapDecoder, IBitmapFrame, IBitmapFrameWithSoftwareBitmap
Public NotInheritable Class BitmapDecoder Implements IBitmapDecoder, IBitmapFrame, IBitmapFrameWithSoftwareBitmap
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

Here's a partial example of creating a decoder object. This example assumes you selected a file with Windows.Storage.Pickers.FileOpenPicker. For full instructions on selecting a file, creating an decoder, and decoding an image see Imaging

file.openAsync(Windows.Storage.FileAccessMode.readWrite).then(function(_stream) {
    stream = _stream;

    return Windows.Graphics.Imaging.BitmapDecoder.createAsync(stream);
}).then(function(decoder) {

    // Your code here.
});

Remarks

Image formats

BitmapDecoder can decode the following formats.

  • JPEG
  • PNG
  • GIF
  • TIFF
  • BMP
  • ICO
  • JPEG-XR
  • Any installed Camera raw formats by using the Microsoft Camera Codec Pack. For a list of decoding formats, see the BitmapEncoder topic.

The BitmapDecoder class implements IBitmapFrame. It provides access to container data as well as data from the first frame. This allows applications to accomplish most common scenarios without needing to retrieve a separate BitmapFrame.

Properties

BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

The default alpha mode of the first frame.

BitmapContainerProperties BitmapContainerProperties BitmapContainerProperties BitmapContainerProperties BitmapContainerProperties

Provides access to the container bitmap properties.

BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

The pixel format that best fits the first frame.

BitmapProperties BitmapProperties BitmapProperties BitmapProperties BitmapProperties

A read-only view of the metadata within the first frame.

BmpDecoderId BmpDecoderId BmpDecoderId BmpDecoderId BmpDecoderId

The unique identifier of the BMP decoder.

DecoderInformation DecoderInformation DecoderInformation DecoderInformation DecoderInformation

Information about the bitmap decoder.

DpiX DpiX DpiX DpiX DpiX

The horizontal resolution of the first frame in dots per inch.

DpiY DpiY DpiY DpiY DpiY

The vertical resolution of the first frame in dots per inch.

FrameCount FrameCount FrameCount FrameCount FrameCount

The number of frames within the image file.

GifDecoderId GifDecoderId GifDecoderId GifDecoderId GifDecoderId

The unique identifier of the GIF decoder.

IcoDecoderId IcoDecoderId IcoDecoderId IcoDecoderId IcoDecoderId

The unique identifier of the ICO decoder.

JpegDecoderId JpegDecoderId JpegDecoderId JpegDecoderId JpegDecoderId

The unique identifier of the JPEG decoder.

JpegXRDecoderId JpegXRDecoderId JpegXRDecoderId JpegXRDecoderId JpegXRDecoderId

The unique identifier of the JPEG-XR decoder.

OrientedPixelHeight OrientedPixelHeight OrientedPixelHeight OrientedPixelHeight OrientedPixelHeight

The height of the first frame in pixels, after any EXIF orientation has been applied to the bitmap.

OrientedPixelWidth OrientedPixelWidth OrientedPixelWidth OrientedPixelWidth OrientedPixelWidth

The width of the first frame in pixels, after any EXIF orientation has been applied to the bitmap.

PixelHeight PixelHeight PixelHeight PixelHeight PixelHeight

The height of the first frame in pixels.

PixelWidth PixelWidth PixelWidth PixelWidth PixelWidth

The width of the first frame in pixels.

PngDecoderId PngDecoderId PngDecoderId PngDecoderId PngDecoderId

The unique identifier of the PNG decoder.

TiffDecoderId TiffDecoderId TiffDecoderId TiffDecoderId TiffDecoderId

The unique identifier of the TIFF decoder.

Methods

CreateAsync(Guid, IRandomAccessStream) CreateAsync(Guid, IRandomAccessStream) CreateAsync(Guid, IRandomAccessStream) CreateAsync(Guid, IRandomAccessStream) CreateAsync(Guid, IRandomAccessStream)

Asynchronously creates a new BitmapDecoder using a specific bitmap codec and initializes it using a stream.

CreateAsync(IRandomAccessStream) CreateAsync(IRandomAccessStream) CreateAsync(IRandomAccessStream) CreateAsync(IRandomAccessStream) CreateAsync(IRandomAccessStream)

Asynchronously creates a new BitmapDecoder and initializes it using a stream.

GetDecoderInformationEnumerator() GetDecoderInformationEnumerator() GetDecoderInformationEnumerator() GetDecoderInformationEnumerator() GetDecoderInformationEnumerator()

The bitmap decoders installed on the system and information about them.

GetFrameAsync(UInt32) GetFrameAsync(UInt32) GetFrameAsync(UInt32) GetFrameAsync(UInt32) GetFrameAsync(UInt32)

Asynchronously retrieves a frame from the image file.

GetPixelDataAsync() GetPixelDataAsync() GetPixelDataAsync() GetPixelDataAsync() GetPixelDataAsync()

Asynchronously requests the pixel data for the frame.

GetPixelDataAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) GetPixelDataAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) GetPixelDataAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) GetPixelDataAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) GetPixelDataAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode)

Asynchronously requests the pixel data for the frame using the specified parameters.

GetPreviewAsync() GetPreviewAsync() GetPreviewAsync() GetPreviewAsync() GetPreviewAsync()

Asynchronously returns a stream containing the preview image.

GetSoftwareBitmapAsync() GetSoftwareBitmapAsync() GetSoftwareBitmapAsync() GetSoftwareBitmapAsync() GetSoftwareBitmapAsync()

Asynchronously gets a SoftwareBitmap representation of the decoded bitmap.

GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode) GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode) GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode) GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode) GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode)

Asynchronously gets a SoftwareBitmap representation of the decoded bitmap.

GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) GetSoftwareBitmapAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode)

Asynchronously gets a SoftwareBitmap representation of the decoded bitmap.

GetThumbnailAsync() GetThumbnailAsync() GetThumbnailAsync() GetThumbnailAsync() GetThumbnailAsync()

Asynchronously returns a stream containing the thumbnail image.

See Also