I​Bitmap​Frame I​Bitmap​Frame I​Bitmap​Frame Interface

Definition

Exposes methods for operating on a single frame of an image.

public : interface IBitmapFramepublic interface IBitmapFramePublic Interface IBitmapFrame
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

Returns the default alpha mode of the frame.

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

The default alpha mode of the frame.

Attributes

Remarks

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

BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

Returns the default pixel format of the frame.

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

The default pixel format of the frame.

Attributes

Remarks

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

BitmapProperties BitmapProperties BitmapProperties

Returns a read-only view of the metadata within the frame.

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

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

Attributes

DpiX DpiX DpiX

Returns the horizontal resolution of the frame in dots per inch.

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

The horizontal resolution of the frame in dots per inch.

Attributes

DpiY DpiY DpiY

Returns the vertical resolution of the frame in dots per inch.

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

The vertical resolution of the frame in dots per inch.

Attributes

OrientedPixelHeight OrientedPixelHeight OrientedPixelHeight

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

public : unsigned short OrientedPixelHeight { get; }public uint OrientedPixelHeight { get; }Public ReadOnly Property OrientedPixelHeight As uint
Value
unsigned short uint uint

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

Attributes

OrientedPixelWidth OrientedPixelWidth OrientedPixelWidth

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

public : unsigned short OrientedPixelWidth { get; }public uint OrientedPixelWidth { get; }Public ReadOnly Property OrientedPixelWidth As uint
Value
unsigned short uint uint

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

Attributes

PixelHeight PixelHeight PixelHeight

Returns the height of the frame in pixels.

public : unsigned short PixelHeight { get; }public uint PixelHeight { get; }Public ReadOnly Property PixelHeight As uint
Value
unsigned short uint uint

The height of the frame in pixels.

Attributes

Remarks

This property ignores any EXIF orientation flag value.

PixelWidth PixelWidth PixelWidth

Returns the width of the frame in pixels.

public : unsigned short PixelWidth { get; }public uint PixelWidth { get; }Public ReadOnly Property PixelWidth As uint
Value
unsigned short uint uint

The width of the frame in pixels.

Attributes

Remarks

This property ignores any EXIF orientation flag value.

Methods

GetPixelDataAsync() GetPixelDataAsync() GetPixelDataAsync()

Asynchronously requests the pixel data for the frame. The resulting 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 (see the Remarks section for more information).

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

Object that manages the asynchronous retrieval of the pixel data.

Attributes

Remarks

An application should not assume that pixel data returned by this method uses any particular pixel format or alpha mode (i.e. 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
transformAn empty transform.
exifOrientationModeThe ExifOrientationMode value RespectExifOrientation.
colorManagementModeThe ColorManagementMode value ColorManageToSRgb.

See Also

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 )
Parameters
pixelFormat
BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

The specified pixel format.

alphaMode
BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

The specified alpha mode.

transform
BitmapTransform BitmapTransform BitmapTransform

The set of transformations to be applied to the frame.

exifOrientationMode
ExifOrientationMode ExifOrientationMode ExifOrientationMode

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

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

Remarks

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

See Also

GetThumbnailAsync() GetThumbnailAsync() GetThumbnailAsync()

Asynchronously retrieves the thumbnail data for the frame.

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

Object that manages the asynchronous retrieval of the thumbnail data.

Attributes