Share via


BitmapEncoder.SetPixelData Method

Definition

Sets pixel data on the frame.

public:
 virtual void SetPixelData(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, unsigned int width, unsigned int height, double dpiX, double dpiY, Platform::Array <byte> ^ pixels) = SetPixelData;
void SetPixelData(BitmapPixelFormat const& pixelFormat, BitmapAlphaMode const& alphaMode, uint32_t const& width, uint32_t const& height, double const& dpiX, double const& dpiY, winrt::array_view <byte> const& pixels);
public void SetPixelData(BitmapPixelFormat pixelFormat, BitmapAlphaMode alphaMode, uint width, uint height, double dpiX, double dpiY, byte[] pixels);
function setPixelData(pixelFormat, alphaMode, width, height, dpiX, dpiY, pixels)
Public Sub SetPixelData (pixelFormat As BitmapPixelFormat, alphaMode As BitmapAlphaMode, width As UInteger, height As UInteger, dpiX As Double, dpiY As Double, pixels As Byte())

Parameters

pixelFormat
BitmapPixelFormat

The pixel format of the pixel data.

alphaMode
BitmapAlphaMode

The alpha mode of the pixel data.

width
UInt32

unsigned int

uint32_t

The width, in pixels, of the pixel data.

height
UInt32

unsigned int

uint32_t

The height, in pixels, of the pixel data.

dpiX
Double

double

The horizontal resolution, in dots per inch, of the pixel data.

dpiY
Double

double

The vertical resolution, in dots per inch, of the pixel data.

pixels

Byte[]

byte[]

The pixel data.

Remarks

This method is synchronous because data is not committed until FlushAsync, GoToNextFrameAsync or GoToNextFrameAsync(IIterable(IKeyValuePair)) is called.

Setting a pixel format of Unknown will result in failure.

This method treats all pixel data as being in the sRGB color space. When you call this method it automatically clears any existing color space information from the frame, including embedded color profiles.

When you are encoding a new image, before you call FlushAsync at the minimum you must set pixel data using this method.

Applies to