SKImageReadPixelsResult Class
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.
Represents the pixel data returned by an asynchronous read-pixels request, valid only for the duration of the callback.
public sealed class SKImageReadPixelsResult : IDisposable
- Inheritance
-
SKImageReadPixelsResult
- Implements
Remarks
An instance is passed to the callback supplied to RequestReadPixels(SKImageInfo, SKRectI, Action<SKImageReadPixelsResult>) or the equivalent method on SKSurface and SKGraphiteContext. The underlying pixels are only valid while the callback runs; to keep the data, copy it out with ToArray(Int32), ToBitmap(), or ToImage().
Results may be planar (for example, a YUV read has more than one plane); use PlaneCount to enumerate the planes.
Properties
| Name | Description |
|---|---|
| PlaneCount |
Gets the number of pixel planes in the result. |
Methods
| Name | Description |
|---|---|
| CopyPlaneTo(Int32, Span<Byte>) |
Copies the specified plane into the destination as tightly-packed pixels, stripping any per-row padding. |
| Dispose() |
Invalidates the result so that its pixel data can no longer be accessed. |
| GetPlaneData(Int32) |
Gets a read-only view over the raw pixel data of the specified plane, including any per-row padding. |
| GetPlaneRowBytes(Int32) |
Gets the number of bytes per row of the specified plane, including any padding. |
| ToArray(Int32) |
Copies the specified plane into a new tightly-packed byte array that outlives the callback. |
| ToBitmap() |
Copies the single-plane result into a new bitmap that outlives the callback. |
| ToImage() |
Copies the single-plane result into a new image that outlives the callback. |