BitmapDecoder BitmapDecoder BitmapDecoder BitmapDecoder Class

Definition

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

public sealed class BitmapDecoderpublic sealed class BitmapDecoderPublic NotInheritable Class BitmapDecoderpublic sealed class BitmapDecoder
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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.

Examples

Here's a partial example of creating a decoder object. This example assumes you selected a file with 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;

        var encoderId;
        switch (fileType) {
            case ".jpg":
                encoderId = Windows.Graphics.Imaging.BitmapEncoder.jpegEncoderId;
                break;
        }
        return Windows.Graphics.Imaging.BitmapEncoder.createAsync(encoderId, stream);
        }).then(function (encoder) {

              // Your code here.
        }

Properties

BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

The default alpha mode of the first frame.

public BitmapAlphaMode BitmapAlphaMode { get; }public BitmapAlphaMode BitmapAlphaMode { get; }Public ReadOnly Property BitmapAlphaMode As BitmapAlphaModepublic BitmapAlphaMode BitmapAlphaMode { get; }
Value
BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

The default alpha mode of the first frame.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This is the alpha mode used when calling the GetPixelDataAsync() method.

BitmapContainerProperties BitmapContainerProperties BitmapContainerProperties BitmapContainerProperties

Provides access to the container bitmap properties.

public BitmapPropertiesView BitmapContainerProperties { get; }public BitmapPropertiesView BitmapContainerProperties { get; }Public ReadOnly Property BitmapContainerProperties As BitmapPropertiesViewpublic BitmapPropertiesView BitmapContainerProperties { get; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Many image file formats do not have container level metadata.

BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

The pixel format that best fits the first frame.

public BitmapPixelFormat BitmapPixelFormat { get; }public BitmapPixelFormat BitmapPixelFormat { get; }Public ReadOnly Property BitmapPixelFormat As BitmapPixelFormatpublic BitmapPixelFormat BitmapPixelFormat { get; }
Value
BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

The pixel format that best fits the first frame.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This is the pixel format used when calling the GetPixelDataAsync() method.

BitmapProperties BitmapProperties BitmapProperties BitmapProperties

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

public BitmapPropertiesView BitmapProperties { get; }public BitmapPropertiesView BitmapProperties { get; }Public ReadOnly Property BitmapProperties As BitmapPropertiesViewpublic BitmapPropertiesView BitmapProperties { get; }
Value
BitmapPropertiesView BitmapPropertiesView BitmapPropertiesView BitmapPropertiesView

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

BmpDecoderId BmpDecoderId BmpDecoderId BmpDecoderId

The unique identifier of the BMP decoder.

public static Guid BmpDecoderId { get; }public static Guid BmpDecoderId { get; }Public Static ReadOnly Property BmpDecoderId As Guidpublic static Guid BmpDecoderId { get; }
Value
System.Guid System.Guid System.Guid System.Guid

The unique identifier of the BMP decoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

DecoderInformation DecoderInformation DecoderInformation DecoderInformation

Information about the bitmap decoder.

public BitmapCodecInformation DecoderInformation { get; }public BitmapCodecInformation DecoderInformation { get; }Public ReadOnly Property DecoderInformation As BitmapCodecInformationpublic BitmapCodecInformation DecoderInformation { get; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

DpiX DpiX DpiX DpiX

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

public double DpiX { get; }public double DpiX { get; }Public ReadOnly Property DpiX As doublepublic double DpiX { get; }
Value
double double double double

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

DpiY DpiY DpiY DpiY

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

public double DpiY { get; }public double DpiY { get; }Public ReadOnly Property DpiY As doublepublic double DpiY { get; }
Value
double double double double

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

FrameCount FrameCount FrameCount FrameCount

The number of frames within the image file.

public uint FrameCount { get; }public uint FrameCount { get; }Public ReadOnly Property FrameCount As uintpublic uint FrameCount { get; }
Value
uint uint uint uint

The number of frames.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

GifDecoderId GifDecoderId GifDecoderId GifDecoderId

The unique identifier of the GIF decoder.

public static Guid GifDecoderId { get; }public static Guid GifDecoderId { get; }Public Static ReadOnly Property GifDecoderId As Guidpublic static Guid GifDecoderId { get; }
Value
System.Guid System.Guid System.Guid System.Guid

The unique identifier of the GIF decoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IcoDecoderId IcoDecoderId IcoDecoderId IcoDecoderId

The unique identifier of the ICO decoder.

public static Guid IcoDecoderId { get; }public static Guid IcoDecoderId { get; }Public Static ReadOnly Property IcoDecoderId As Guidpublic static Guid IcoDecoderId { get; }
Value
System.Guid System.Guid System.Guid System.Guid

The unique identifier of the ICO decoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

JpegDecoderId JpegDecoderId JpegDecoderId JpegDecoderId

The unique identifier of the JPEG decoder.

public static Guid JpegDecoderId { get; }public static Guid JpegDecoderId { get; }Public Static ReadOnly Property JpegDecoderId As Guidpublic static Guid JpegDecoderId { get; }
Value
System.Guid System.Guid System.Guid System.Guid

The unique identifier of the JPEG decoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

JpegXRDecoderId JpegXRDecoderId JpegXRDecoderId JpegXRDecoderId

The unique identifier of the JPEG-XR decoder.

public static Guid JpegXRDecoderId { get; }public static Guid JpegXRDecoderId { get; }Public Static ReadOnly Property JpegXRDecoderId As Guidpublic static Guid JpegXRDecoderId { get; }
Value
System.Guid System.Guid System.Guid System.Guid

The unique identifier of the JPEG-XR decoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

OrientedPixelHeight OrientedPixelHeight OrientedPixelHeight OrientedPixelHeight

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

public uint OrientedPixelHeight { get; }public uint OrientedPixelHeight { get; }Public ReadOnly Property OrientedPixelHeight As uintpublic uint OrientedPixelHeight { get; }
Value
uint uint uint uint

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Use this property if you need to know the height of an image or of pixel data that has EXIF orientation applied, for example, if you call GetPixelDataAsync() and specify RespectExifOrientation. Also, the HTML img element in Windows app using JavaScript, and Image respect EXIF orientation.

If you need pixel dimensions of the image as it is natively stored, use the PixelHeight property.

OrientedPixelWidth OrientedPixelWidth OrientedPixelWidth OrientedPixelWidth

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

public uint OrientedPixelWidth { get; }public uint OrientedPixelWidth { get; }Public ReadOnly Property OrientedPixelWidth As uintpublic uint OrientedPixelWidth { get; }
Value
uint uint uint uint

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Use this property in the same way as OrientedPixelHeight is used if you need to know the width of an image or of pixel data.

PixelHeight PixelHeight PixelHeight PixelHeight

The height of the first frame in pixels.

public uint PixelHeight { get; }public uint PixelHeight { get; }Public ReadOnly Property PixelHeight As uintpublic uint PixelHeight { get; }
Value
uint uint uint uint

The height of the first frame in pixels.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Use PixelHeight for pixel dimensions of the image as it is natively stored.

PixelWidth PixelWidth PixelWidth PixelWidth

The width of the first frame in pixels.

public uint PixelWidth { get; }public uint PixelWidth { get; }Public ReadOnly Property PixelWidth As uintpublic uint PixelWidth { get; }
Value
uint uint uint uint

The width of the first frame in pixels.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Use PixelWidth for pixel dimensions of the image as it is natively stored.

PngDecoderId PngDecoderId PngDecoderId PngDecoderId

The unique identifier of the PNG decoder.

public static Guid PngDecoderId { get; }public static Guid PngDecoderId { get; }Public Static ReadOnly Property PngDecoderId As Guidpublic static Guid PngDecoderId { get; }
Value
System.Guid System.Guid System.Guid System.Guid

The unique identifier of the PNG decoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

TiffDecoderId TiffDecoderId TiffDecoderId TiffDecoderId

The unique identifier of the TIFF decoder.

public static Guid TiffDecoderId { get; }public static Guid TiffDecoderId { get; }Public Static ReadOnly Property TiffDecoderId As Guidpublic static Guid TiffDecoderId { get; }
Value
System.Guid System.Guid System.Guid System.Guid

The unique identifier of the TIFF decoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

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.

public static IAsyncOperation<BitmapDecoder> CreateAsync(Guid decoderId, IRandomAccessStream stream)public static IAsyncOperation<BitmapDecoder> CreateAsync(Guid decoderId, IRandomAccessStream stream)Public Static Function CreateAsync(decoderId As Guid, stream As IRandomAccessStream) As IAsyncOperation( Of BitmapDecoder )public static IAsyncOperation<BitmapDecoder> CreateAsync(Guid decoderId, IRandomAccessStream stream)
Parameters
decoderId
System.Guid System.Guid System.Guid System.Guid

The unique identifier of the specified bitmap codec.

stream
IRandomAccessStream IRandomAccessStream IRandomAccessStream IRandomAccessStream

The stream containing the image file to be decoded.

Returns

An object that manages the asynchronous creation of a new BitmapDecoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This method allows the application to explicitly select the bitmap decoder to be used and bypass any automatic codec arbitration. The unique identifiers of the built-in decoders are available as properties on BitmapDecoder. In addition, the unique identifier of any installed decoder can be obtained using the GetDecoderInformationEnumerator() method.

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

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

public static IAsyncOperation<BitmapDecoder> CreateAsync(IRandomAccessStream stream)public static IAsyncOperation<BitmapDecoder> CreateAsync(IRandomAccessStream stream)Public Static Function CreateAsync(stream As IRandomAccessStream) As IAsyncOperation( Of BitmapDecoder )public static IAsyncOperation<BitmapDecoder> CreateAsync(IRandomAccessStream stream)
Parameters
stream
IRandomAccessStream IRandomAccessStream IRandomAccessStream IRandomAccessStream

The stream containing the image file to be decoded.

Returns

An object that manages the asynchronous creation of a new BitmapDecoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Windows.Graphics.Imaging automatically determines the correct bitmap decoder to decode the stream.

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

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

public static IVectorView<BitmapCodecInformation> GetDecoderInformationEnumerator()public static IVectorView<BitmapCodecInformation> GetDecoderInformationEnumerator()Public Static Function GetDecoderInformationEnumerator() As IVectorView( Of BitmapCodecInformation )public static IVectorView<BitmapCodecInformation> GetDecoderInformationEnumerator()
Returns

A list of BitmapCodecInformation objects containing information about each decoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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

Asynchronously retrieves a frame from the image file.

public IAsyncOperation<BitmapFrame> GetFrameAsync(UInt32 frameIndex)public IAsyncOperation<BitmapFrame> GetFrameAsync(UInt32 frameIndex)Public Function GetFrameAsync(frameIndex As UInt32) As IAsyncOperation( Of BitmapFrame )public IAsyncOperation<BitmapFrame> GetFrameAsync(UInt32 frameIndex)
Parameters
frameIndex
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The zero-based index of the frame to be retrieved.

Returns

Object that manages the asynchronous retrieval of the frame.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You don't need to use this method to access data from the first frame in an image file. BitmapDecoder already provides a method to access the first frame.

You can get the total number of frames on the image using the FrameCount property.

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

Asynchronously requests the pixel data for the frame.

public IAsyncOperation<PixelDataProvider> GetPixelDataAsync()public IAsyncOperation<PixelDataProvider> GetPixelDataAsync()Public Function GetPixelDataAsync() As IAsyncOperation( Of PixelDataProvider )public IAsyncOperation<PixelDataProvider> GetPixelDataAsync()
Returns

Object that manages the asynchronous retrieval of the pixel data.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The pixel data array will use the bitmap pixel format and alpha mode specified in the BitmapPixelFormat and BitmapAlphaMode properties. It will also have color management and EXIF orientation applied.

An application should not assume that pixel data returned by this method uses any particular pixel format or alpha mode (like Rgba8 with premultiplied alpha). Instead, it should always check the BitmapPixelFormat and BitmapAlphaMode properties and handle the data accordingly.

As a convenience, this method performs color management from the frame’s embedded color space (if it exists) to the sRGB color space. If there is no embedded color profile data, then no color management is performed. This method also attempts to read the EXIF orientation flag on the frame, and if it exists, will perform the necessary transformation to correctly orient the pixel data.

In order to retrieve the correct bitmap pixel width and height, the application should read the OrientedPixelWidth and OrientedPixelHeight properties, instead of the PixelWidth and PixelHeight properties.

This method is equivalent to calling the GetPixelDataAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) method with the following arguments:

ArgumentValue
pixelFormatThe value of the BitmapPixelFormat property.
alphaModeThe value of the BitmapAlphaMode property
transformA new @Windows.Graphics.Imaging.BitmapTransform.</td></tr>
exifOrientationModeThe ExifOrientationMode value RespectExifOrientation.
colorManagementModeThe ColorManagementMode value ColorManageToSRgb.

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.

public IAsyncOperation<PixelDataProvider> GetPixelDataAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, BitmapTransform transform, ExifOrientationMode exifOrientationMode, ColorManagementMode colorManagementMode)public IAsyncOperation<PixelDataProvider> GetPixelDataAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, BitmapTransform transform, ExifOrientationMode exifOrientationMode, ColorManagementMode colorManagementMode)Public Function GetPixelDataAsync(pixelFormat As BitmapPixelFormat, alphaMode As BitmapAlphaMode, transform As BitmapTransform, exifOrientationMode As ExifOrientationMode, colorManagementMode As ColorManagementMode) As IAsyncOperation( Of PixelDataProvider )public IAsyncOperation<PixelDataProvider> GetPixelDataAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, BitmapTransform transform, ExifOrientationMode exifOrientationMode, ColorManagementMode colorManagementMode)
Parameters
alphaMode
BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

The specified alpha mode.

transform
BitmapTransform BitmapTransform BitmapTransform BitmapTransform

The set of transformations to be applied to the frame.

exifOrientationMode
ExifOrientationMode ExifOrientationMode ExifOrientationMode ExifOrientationMode

Indicates whether the EXIF orientation flag should be ignored or respected.

colorManagementMode
ColorManagementMode ColorManagementMode ColorManagementMode ColorManagementMode

Indicates whether the pixel data should be color managed to the sRGB color space.

Returns

Object that manages the asynchronous retrieval of the pixel data.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This method should be used instead of GetPixelDataAsync() if the application needs finer grained control over the pixel data array.

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

Asynchronously returns a stream containing the preview image.

public IAsyncOperation<ImageStream> GetPreviewAsync()public IAsyncOperation<ImageStream> GetPreviewAsync()Public Function GetPreviewAsync() As IAsyncOperation( Of ImageStream )public IAsyncOperation<ImageStream> GetPreviewAsync()
Returns

Object that manages the asynchronous retrieval of the bitmap preview data.

The preview data is returned in the form of an image stream. You can display it using an image control, or read and edit it using BitmapDecoder and BitmapEncoder.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Some image formats, like JPEG-XR and camera RAW formats, contain an image preview. The preview is generally higher resolution than a thumbnail. This is an advantage because decoding the preview can be faster than decoding the full RAW image, but provides comparable fidelity when displaying images

If the image does not contain a preview, this operation fails with HRESULT WINCODEC_ERR_UNSUPPORTEDOPERATION.

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

Asynchronously gets a SoftwareBitmap representation of the decoded bitmap.

public IAsyncOperation<SoftwareBitmap> GetSoftwareBitmapAsync()public IAsyncOperation<SoftwareBitmap> GetSoftwareBitmapAsync()Public Function GetSoftwareBitmapAsync() As IAsyncOperation( Of SoftwareBitmap )public IAsyncOperation<SoftwareBitmap> GetSoftwareBitmapAsync()
Returns

An asynchronous operation that returns a SoftwareBitmap on successful completion.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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

Asynchronously gets a SoftwareBitmap representation of the decoded bitmap.

public IAsyncOperation<SoftwareBitmap> GetSoftwareBitmapAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode)public IAsyncOperation<SoftwareBitmap> GetSoftwareBitmapAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode)Public Function GetSoftwareBitmapAsync(pixelFormat As BitmapPixelFormat, alphaMode As BitmapAlphaMode) As IAsyncOperation( Of SoftwareBitmap )public IAsyncOperation<SoftwareBitmap> GetSoftwareBitmapAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode)
Parameters
pixelFormat
BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

The pixel format of the software bitmap.

alphaMode
BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

The alpha mode of the software bitmap.

Returns

An asynchronous operation that returns a SoftwareBitmap on successful completion.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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.

public IAsyncOperation<SoftwareBitmap> GetSoftwareBitmapAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, BitmapTransform transform, ExifOrientationMode exifOrientationMode, ColorManagementMode colorManagementMode)public IAsyncOperation<SoftwareBitmap> GetSoftwareBitmapAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, BitmapTransform transform, ExifOrientationMode exifOrientationMode, ColorManagementMode colorManagementMode)Public Function GetSoftwareBitmapAsync(pixelFormat As BitmapPixelFormat, alphaMode As BitmapAlphaMode, transform As BitmapTransform, exifOrientationMode As ExifOrientationMode, colorManagementMode As ColorManagementMode) As IAsyncOperation( Of SoftwareBitmap )public IAsyncOperation<SoftwareBitmap> GetSoftwareBitmapAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, BitmapTransform transform, ExifOrientationMode exifOrientationMode, ColorManagementMode colorManagementMode)
Parameters
pixelFormat
BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

The pixel format of the software bitmap.

alphaMode
BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

The alpha mode of the software bitmap.

transform
BitmapTransform BitmapTransform BitmapTransform BitmapTransform

The transform of the software bitmap.

exifOrientationMode
ExifOrientationMode ExifOrientationMode ExifOrientationMode ExifOrientationMode

The EXIF orientation mode of the software bitmap.

colorManagementMode
ColorManagementMode ColorManagementMode ColorManagementMode ColorManagementMode

The color management mode of the software bitmap.

Returns

An asynchronous operation that returns a SoftwareBitmap on successful completion.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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

Asynchronously returns a stream containing the thumbnail image.

public IAsyncOperation<ImageStream> GetThumbnailAsync()public IAsyncOperation<ImageStream> GetThumbnailAsync()Public Function GetThumbnailAsync() As IAsyncOperation( Of ImageStream )public IAsyncOperation<ImageStream> GetThumbnailAsync()
Returns

Object that manages the asynchronous retrieval of the thumbnail stream.

The thumbnail data is returned in the form of an image stream. You can display it using an image control, or read and edit it using BitmapDecoder and BitmapEncoder

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Many image formats, like JPEG and TIFF, allow a small sized thumbnail of the full image to be embedded within a frame. If the image does not contain a thumbnail, then this operation will fail with HRESULT WINCODEC_ERR_CODECNOTHUMBNAIL. If it exists, the EXIF orientation flag on the frame is automatically applied to the thumbnail before it is returned.