BitmapFrame.GetPixelDataAsync Method

Definition

Overloads

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).

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

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

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:
 virtual IAsyncOperation<PixelDataProvider ^> ^ GetPixelDataAsync() = GetPixelDataAsync;
/// [Windows.Foundation.Metadata.Overload("GetPixelDataAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<PixelDataProvider> GetPixelDataAsync();
[Windows.Foundation.Metadata.Overload("GetPixelDataAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<PixelDataProvider> GetPixelDataAsync();
function getPixelDataAsync()
Public Function GetPixelDataAsync () As IAsyncOperation(Of PixelDataProvider)

Returns

IAsyncOperation<PixelDataProvider>

Object that manages the asynchronous retrieval of the pixel data.

Implements

Attributes

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.

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
*pixelFormat*The value of the @"Windows.Graphics.Imaging.BitmapFrame.BitmapPixelFormat?text=BitmapPixelFormat" property.
*alphaMode*The value of the @"Windows.Graphics.Imaging.BitmapFrame.BitmapAlphaMode?text=BitmapAlphaMode" property
*transform*An empty transform.
*exifOrientationMode*The @"Windows.Graphics.Imaging.ExifOrientationMode?text=ExifOrientationMode" value **RespectExifOrientation**.
*colorManagementMode*The @"Windows.Graphics.Imaging.ColorManagementMode?text=ColorManagementMode" value **ColorManageToSRgb**.

See also

Applies to

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

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

public:
 virtual IAsyncOperation<PixelDataProvider ^> ^ GetPixelDataAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, BitmapTransform ^ transform, ExifOrientationMode exifOrientationMode, ColorManagementMode colorManagementMode) = GetPixelDataAsync;
/// [Windows.Foundation.Metadata.Overload("GetPixelDataTransformedAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<PixelDataProvider> GetPixelDataAsync(BitmapPixelFormat const& pixelFormat, BitmapAlphaMode const& alphaMode, BitmapTransform const& transform, ExifOrientationMode const& exifOrientationMode, ColorManagementMode const& colorManagementMode);
[Windows.Foundation.Metadata.Overload("GetPixelDataTransformedAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<PixelDataProvider> GetPixelDataAsync(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, BitmapTransform transform, ExifOrientationMode exifOrientationMode, ColorManagementMode colorManagementMode);
function getPixelDataAsync(pixelFormat, alphaMode, transform, exifOrientationMode, 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

The specified pixel format.

alphaMode
BitmapAlphaMode

The specified alpha mode.

transform
BitmapTransform

The set of transformations to be applied to the frame.

exifOrientationMode
ExifOrientationMode

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

colorManagementMode
ColorManagementMode

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

Returns

IAsyncOperation<PixelDataProvider>

Object that manages the asynchronous retrieval of the pixel data.

Implements

Attributes

Remarks

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

If you set the exifOrientationMode parameter to RespectExifOrientation, the resulting pixel data will have dimensions that are defined by OrientedPixelWidth and OrientedPixelHeight instead of the PixelWidth and PixelHeight. If you are also applying a transformation, refer to BitmapTransform for information about correctly handling coordinate spaces.

See also

Applies to