Provides read access to bitmap container data as well as data from the first frame.
Syntax
var bitmapDecoder = Windows.Graphics.Imaging.BitmapDecoder;
Attributes
- MarshalingBehaviorAttribute(Agile)
- StaticAttribute(Windows.Graphics.Imaging.IBitmapDecoderStatics, NTDDI_WIN8)
- VersionAttribute(NTDDI_WIN8)
Members
The BitmapDecoder class has these types of members:
Methods
The BitmapDecoder class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| CreateAsync(Guid, IRandomAccessStream) | Asynchronously creates a new BitmapDecoder using a specific bitmap codec and initializes it using a stream. |
| CreateAsync(IRandomAccessStream) | Asynchronously creates a new BitmapDecoder and initializes it using a stream. |
| GetDecoderInformationEnumerator | The bitmap decoders installed on the system and information about them. |
| GetFrameAsync | Asynchronously retrieves a frame from the image file. |
| GetPixelDataAsync() | Asynchronously requests the pixel data for the frame. |
| GetPixelDataAsync(BitmapPixelFormat, BitmapAlphaMode, BitmapTransform, ExifOrientationMode, ColorManagementMode) | Asynchronously requests the pixel data for the frame using the specified parameters. |
| GetPreviewAsync | Asynchronously returns a stream containing the preview image. |
| GetThumbnailAsync | Asynchronously returns a stream containing the thumbnail image. |
Properties
The BitmapDecoder class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | The default alpha mode of the first frame. | |
| Read-only | Provides access to the container bitmap properties. | |
| Read-only | The pixel format that best fits the first frame. | |
| Read-only | A read-only view of the metadata within the first frame. | |
| Read-only | The unique identifier of the BMP decoder. | |
| Read-only | Information about the bitmap decoder. | |
| Read-only | The horizontal resolution of the first frame in dots per inch. | |
| Read-only | The vertical resolution of the first frame in dots per inch. | |
| Read-only | The number of frames within the image file. | |
| Read-only | The unique identifier of the GIF decoder. | |
| Read-only | The unique identifier of the ICO decoder. | |
| Read-only | The unique identifier of the JPEG decoder. | |
| Read-only | The unique identifier of the JPEG-XR decoder. | |
| Read-only | The height of the first frame in pixels, after any EXIF orientation has been applied to the bitmap. | |
| Read-only | The width of the first frame in pixels, after any EXIF orientation has been applied to the bitmap. | |
| Read-only | The height of the first frame in pixels. | |
| Read-only | The width of the first frame in pixels. | |
| Read-only | The unique identifier of the PNG decoder. | |
| Read-only | The unique identifier of the TIFF decoder. |
Remarks
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 Windows.Storage.Pickers.FileOpenPicker. For full instructions on selecting a file, creating an decoder, and decoding an image see How to decode an image
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. }
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
|
|
Metadata |
|
Build date: 12/4/2012