draw To Buffer
Renders the current state of an artboard/state machine pair into an off-screen buffer that can be used for snapshot comparisons.
⚠️ Unlike other CommandQueue methods, this method is synchronous and blocks the calling thread.
Parameters
The handle of the artboard to draw.
The handle of the state machine to advance/draw.
The surface to draw to, likely created from createImageSurface.
The byte array buffer to render into. Must be at least width * height * 4 bytes in size.
The width of the buffer to render.
The height of the buffer to render.
Fit to use when drawing.
Clear color used prior to drawing, defaults to transparent.
Throws
If the buffer could not be drawn to for any reason. Further details can be found in the exception message.
If the CommandQueue has been released or surface is closed.