WriteableBitmap.WritePixels 메서드

정의

쓰기 가능한 비트맵의 픽셀을 업데이트합니다.

오버로드

Name Description
WritePixels(Int32Rect, Array, Int32, Int32)

비트맵의 지정된 영역에서 픽셀을 업데이트합니다.

WritePixels(Int32Rect, IntPtr, Int32, Int32)

비트맵의 지정된 영역에서 픽셀을 업데이트합니다.

WritePixels(Int32Rect, Array, Int32, Int32, Int32)

비트맵의 지정된 영역에서 픽셀을 업데이트합니다.

WritePixels(Int32Rect, IntPtr, Int32, Int32, Int32, Int32)

비트맵의 지정된 영역에서 픽셀을 업데이트합니다.

WritePixels(Int32Rect, Array, Int32, Int32)

비트맵의 지정된 영역에서 픽셀을 업데이트합니다.

public:
 void WritePixels(System::Windows::Int32Rect sourceRect, Array ^ pixels, int stride, int offset);
[System.Security.SecurityCritical]
public void WritePixels(System.Windows.Int32Rect sourceRect, Array pixels, int stride, int offset);
[<System.Security.SecurityCritical>]
member this.WritePixels : System.Windows.Int32Rect * Array * int * int -> unit
Public Sub WritePixels (sourceRect As Int32Rect, pixels As Array, stride As Integer, offset As Integer)

매개 변수

sourceRect
Int32Rect

업데이트할 사각형입니다 WriteableBitmap .

pixels
Array

비트맵을 업데이트하는 데 사용되는 픽셀 배열입니다.

stride
Int32

에서 업데이트 영역 pixels의 보폭입니다.

offset
Int32

입력 버퍼 오프셋입니다.

특성

예외

다음 조건 중 하나 이상이 true입니다.

sourceRect는 .의 범위를 벗어나는 경우 WriteableBitmap

stride < 1

offset < 0

pixelsnull입니다.

pixels 에는 1 또는 2가 아닌 순위가 있거나 길이가 0보다 작거나 같습니다.

예제

다음 코드 예제에서는 메서드를 사용하여 백 버퍼의 픽셀을 업데이트하는 방법을 보여 있습니다 WritePixels .

static void ErasePixel(MouseEventArgs e)
{
    byte[] ColorData = { 0, 0, 0, 0 }; // B G R

    Int32Rect rect = new Int32Rect(
            (int)(e.GetPosition(i).X), 
            (int)(e.GetPosition(i).Y), 
            1, 
            1);

    writeableBitmap.WritePixels( rect, ColorData, 4, 0);
}

설명

WritePixels(Int32Rect, Array, Int32, Int32, Int32) 메서드를 사용하는 방법보다 오버로드 및 WritePixels(Int32Rect, IntPtr, Int32, Int32, Int32, Int32) 오버로드를 사용하는 것이 좋습니다.

메모

부분 신뢰에서 오버로드를 WritePixels(Int32Rect, Array, Int32, Int32, Int32) 사용합니다.

적용 대상

WritePixels(Int32Rect, IntPtr, Int32, Int32)

비트맵의 지정된 영역에서 픽셀을 업데이트합니다.

public:
 void WritePixels(System::Windows::Int32Rect sourceRect, IntPtr buffer, int bufferSize, int stride);
[System.Security.SecurityCritical]
public void WritePixels(System.Windows.Int32Rect sourceRect, IntPtr buffer, int bufferSize, int stride);
[<System.Security.SecurityCritical>]
member this.WritePixels : System.Windows.Int32Rect * nativeint * int * int -> unit
Public Sub WritePixels (sourceRect As Int32Rect, buffer As IntPtr, bufferSize As Integer, stride As Integer)

매개 변수

sourceRect
Int32Rect

업데이트할 사각형입니다 WriteableBitmap .

buffer
IntPtr

nativeint

비트맵을 업데이트하는 데 사용되는 입력 버퍼입니다.

bufferSize
Int32

입력 버퍼의 크기입니다.

stride
Int32

에서 업데이트 영역 buffer의 보폭입니다.

특성

예외

다음 조건 중 하나 이상이 true입니다.

sourceRect는 .의 범위를 벗어나는 경우 WriteableBitmap

bufferSize < 1

stride < 1

buffernull입니다.

설명

WritePixels(Int32Rect, Array, Int32, Int32, Int32) 메서드를 사용하는 방법보다 오버로드 및 WritePixels(Int32Rect, IntPtr, Int32, Int32, Int32, Int32) 오버로드를 사용하는 것이 좋습니다.

메모

부분 신뢰에서 오버로드를 WritePixels(Int32Rect, Array, Int32, Int32, Int32) 사용합니다.

적용 대상

WritePixels(Int32Rect, Array, Int32, Int32, Int32)

비트맵의 지정된 영역에서 픽셀을 업데이트합니다.

public:
 void WritePixels(System::Windows::Int32Rect sourceRect, Array ^ sourceBuffer, int sourceBufferStride, int destinationX, int destinationY);
[System.Security.SecurityCritical]
public void WritePixels(System.Windows.Int32Rect sourceRect, Array sourceBuffer, int sourceBufferStride, int destinationX, int destinationY);
[<System.Security.SecurityCritical>]
member this.WritePixels : System.Windows.Int32Rect * Array * int * int * int -> unit
Public Sub WritePixels (sourceRect As Int32Rect, sourceBuffer As Array, sourceBufferStride As Integer, destinationX As Integer, destinationY As Integer)

매개 변수

sourceRect
Int32Rect

복사할 사각형 sourceBuffer 입니다.

sourceBuffer
Array

비트맵을 업데이트하는 데 사용되는 입력 버퍼입니다.

sourceBufferStride
Int32

입력 버퍼의 보폭(바이트)입니다.

destinationX
Int32

백 버퍼에서 가장 왼쪽 픽셀의 대상 x 좌표입니다.

destinationY
Int32

백 버퍼에서 최상위 픽셀의 대상 y 좌표입니다.

특성

예외

다음 조건 중 하나 이상이 true입니다.

sourceRect는 .의 범위를 벗어나는 경우 WriteableBitmap

destinationX 또는 destinationY .의 범위를 벗어났습니다 WriteableBitmap.

sourceBufferStride < 1

sourceBuffernull입니다.

sourceBuffer 에는 1 또는 2가 아닌 순위가 있거나 길이가 0보다 작거나 같습니다.

설명

메서드를 WritePixels 호출하여 WriteableBitmapsourceBuffer내용으로 자동으로 업데이트합니다. 이 메서드를 호출하는 것은 클래스 설명에 WriteableBitmap 설명된 Lock 워크플로 및 사용과 Unlock 동일합니다.

메모

부분 신뢰에서 이 오버로드를 사용합니다.

추가 정보

적용 대상

WritePixels(Int32Rect, IntPtr, Int32, Int32, Int32, Int32)

비트맵의 지정된 영역에서 픽셀을 업데이트합니다.

public:
 void WritePixels(System::Windows::Int32Rect sourceRect, IntPtr sourceBuffer, int sourceBufferSize, int sourceBufferStride, int destinationX, int destinationY);
[System.Security.SecurityCritical]
public void WritePixels(System.Windows.Int32Rect sourceRect, IntPtr sourceBuffer, int sourceBufferSize, int sourceBufferStride, int destinationX, int destinationY);
[<System.Security.SecurityCritical>]
member this.WritePixels : System.Windows.Int32Rect * nativeint * int * int * int * int -> unit
Public Sub WritePixels (sourceRect As Int32Rect, sourceBuffer As IntPtr, sourceBufferSize As Integer, sourceBufferStride As Integer, destinationX As Integer, destinationY As Integer)

매개 변수

sourceRect
Int32Rect

복사할 사각형 sourceBuffer 입니다.

sourceBuffer
IntPtr

nativeint

비트맵을 업데이트하는 데 사용되는 입력 버퍼입니다.

sourceBufferSize
Int32

입력 버퍼의 크기입니다.

sourceBufferStride
Int32

입력 버퍼의 보폭(바이트)입니다.

destinationX
Int32

백 버퍼에서 가장 왼쪽 픽셀의 대상 x 좌표입니다.

destinationY
Int32

백 버퍼에서 최상위 픽셀의 대상 y 좌표입니다.

특성

예외

다음 조건 중 하나 이상이 true입니다.

sourceRect는 .의 범위를 벗어나는 경우 WriteableBitmap

destinationX 또는 destinationY .의 범위를 벗어났습니다 WriteableBitmap.

sourceBufferSize < 1

sourceBufferStride < 1

sourceBuffernull입니다.

설명

메서드를 WritePixels 호출하여 WriteableBitmapsourceBuffer내용으로 자동으로 업데이트합니다. 이 메서드를 호출하는 것은 클래스 설명에 WriteableBitmap 설명된 Lock 워크플로 및 사용과 Unlock 동일합니다.

메모

부분 신뢰에서 오버로드를 WritePixels(Int32Rect, Array, Int32, Int32, Int32) 사용합니다.

추가 정보

적용 대상