BitmapEncoder.SetPixelData | setPixelData method

Applies to Windows and Windows Phone

Sets pixel data on the frame.

Syntax


bitmapEncoder.setPixelData(pixelFormat, alphaMode, width, height, dpiX, dpiY, pixels);

Parameters

pixelFormat

Type: BitmapPixelFormat

The pixel format of the pixel data.

alphaMode

Type: BitmapAlphaMode

The alpha mode of the pixel data.

width

Type: Number [JavaScript] | System.UInt32 [.NET] | uint32 [C++]

The width, in pixels, of the pixel data.

height

Type: Number [JavaScript] | System.UInt32 [.NET] | uint32 [C++]

The height, in pixels, of the pixel data.

dpiX

Type: Number [JavaScript] | System.Double [.NET] | float64 [C++]

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

dpiY

Type: Number [JavaScript] | System.Double [.NET] | float64 [C++]

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

pixels

Type: array of Number [JavaScript] | System.Byte[] [.NET] | Platform::Array<uint8> [C++]

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Graphics.Imaging
Windows::Graphics::Imaging [C++]

Metadata

Windows.winmd

See also

BitmapEncoder

 

 

Show:
© 2014 Microsoft