CanvasBitmapGetPixelBytes Method (Int32, Int32, Int32, Int32) |
Returns an array of raw byte data for a subregion of the bitmap.
Namespace:
Microsoft.Graphics.Canvas
Assembly:
Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax public byte[] GetPixelBytes(
int left,
int top,
int width,
int height
)
Parameters
- left
- Type: SystemInt32
- top
- Type: SystemInt32
- width
- Type: SystemInt32
- height
- Type: SystemInt32
Return Value
Type:
ByteRemarks -
Works on bitmaps of any format.
-
left, top, width and height are specified in pixels (not DIPs).
-
For uncompressed texture formats, the size of the array is width *
height * (bytes per pixel). The number of bytes per pixel is
determined by Format. For a
CanvasBitmap with the default format of
DirectXPixelFormat.B8G8R8A8UintNormalized this is 4.
-
For block compressed texture formats, the size of the array is
width * height * (bytes per block) /
16. See Bitmap block compression
page for more information.
See Also