C# 클래스 WinRTXamlToolkit.Imaging.IBufferExtensions.PixelBufferInfo

Gives access to the pixels of a WriteableBitmap given an IBuffer exposed by Pixels property.
Note that creating this object copies the pixels buffer into the Bytes byte array for quick pixel access and the array needs to be copied back to the pixels buffer to update the bitmap with a call to UpdateFromBytes(). This is acceptable for convenience and possibly best for performance in some scenarios, but it does add some upfront overhead as well overhead to update the bitmap at the end. This is only a theory and for better performance it might be good to test different approaches. The goal of this approach is code simplicity. For best performance using native code and/or DirectX is recommended.
파일 보기 프로젝트 열기: xyzzer/WinRTXamlToolkit 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Bytes byte[]

공개 메소드들

메소드 설명
MaxDiff ( int i, int color ) : byte

Returns the maximum difference between any of the R/G/B/A components of a color at given index and the one passed as parameter.

PixelBufferInfo ( Windows.Storage.Streams.IBuffer pixelBuffer ) : System

Initializes a new instance of the PixelBufferInfo class.

UpdateFromBytes ( ) : void

Updates the associated pixel buffer from bytes.

this ( int i ) : int

Gets or sets the System.Int32 containing an ARGB format pixel at index i in the buffer.

To access a pixel at position x,y you need to get pixels[wb.PixelWidth * y + x].

메소드 상세

MaxDiff() 공개 메소드

Returns the maximum difference between any of the R/G/B/A components of a color at given index and the one passed as parameter.
public MaxDiff ( int i, int color ) : byte
i int Pixel index
color int Color to compare to
리턴 byte

PixelBufferInfo() 공개 메소드

Initializes a new instance of the PixelBufferInfo class.
public PixelBufferInfo ( Windows.Storage.Streams.IBuffer pixelBuffer ) : System
pixelBuffer Windows.Storage.Streams.IBuffer The pixel buffer returned by WriteableBitmap.PixelBuffer.
리턴 System

UpdateFromBytes() 공개 메소드

Updates the associated pixel buffer from bytes.
public UpdateFromBytes ( ) : void
리턴 void

this() 공개 메소드

Gets or sets the System.Int32 containing an ARGB format pixel at index i in the buffer.
To access a pixel at position x,y you need to get pixels[wb.PixelWidth * y + x].
public this ( int i ) : int
i int The buffer index.
리턴 int

프로퍼티 상세

Bytes 공개적으로 프로퍼티

The bytes of the pixel stream.
public byte[] Bytes
리턴 byte[]