SKSurface.ReadPixels(SKImageInfo, IntPtr, Int32, Int32, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies the pixels from the surface into the specified buffer.
public bool ReadPixels (SkiaSharp.SKImageInfo dstInfo, IntPtr dstPixels, int dstRowBytes, int srcX, int srcY);
Parameters
- dstInfo
- SKImageInfo
The image information describing the destination pixel buffer.
- dstPixels
- IntPtr
The pixel buffer to read the pixel data into.
- dstRowBytes
- Int32
The number of bytes in each row of in the destination buffer.
- srcX
- Int32
The source x-coordinate to start reading from.
- srcY
- Int32
The source y-coordinate to start reading from.
Returns
Returns true
if the pixels were read, or false
if there was an error.
Remarks
This method may return false
if the source rectangle [srcX
, srcY
, dstInfo.Width, dstInfo.Height] does not intersect the surface, or if the color type/alpha type could not be converted to the destination types.