Share via


BitmapEncoder.SetPixelData 方法

定義

設定畫面上的圖元資料。

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

參數

pixelFormat
BitmapPixelFormat

圖元資料的像素格式。

alphaMode
BitmapAlphaMode

圖元資料的 Alpha 模式。

width
UInt32

unsigned int

uint32_t

圖元資料的寬度,以圖元為單位。

height
UInt32

unsigned int

uint32_t

圖元資料的高度,以圖元為單位。

dpiX
Double

double

圖元資料的水準解析度,以點為單位。

dpiY
Double

double

圖元資料的垂直解析度,以點為單位。

pixels

Byte[]

byte[]

圖元資料。

備註

此方法是同步的,因為 除非呼叫 FlushAsyncGoToNextFrameAsyncGoToNextFrameAsync (IIterable (IKeyValuePair) ) ,否則不會認可資料。

設定 [未知 ] 的像素格式將會導致失敗。

此方法會將所有圖元資料視為在 sRGB 色彩空間中。 當您呼叫此方法時,會自動清除框架中任何現有的色彩空間資訊,包括內嵌色彩設定檔。

當您編碼新影像時,在呼叫 FlushAsync 之前,您至少必須使用此方法來設定圖元資料。

適用於