BitmapEncoder.SetPixelData(BitmapPixelFormat, BitmapAlphaMode, UInt32, UInt32, Double, Double, Byte[]) 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 pixelFormat, BitmapAlphaMode alphaMode, uint32_t width, uint32_t height, double dpiX, double dpiY, std::Array <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
The width, in pixels, of the pixel data.
- height
- UInt32
The height, in pixels, of the pixel data.
- dpiX
- Double
The horizontal resolution, in dots per inch, of the pixel data.
- dpiY
- Double
The vertical resolution, in dots per inch, of the pixel data.
- pixels
- 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.