Drawing Canvas APIs

Ashley's avatar
Medal
Construct Team Founder
Published 22 Aug, 2019
63 words
<1 min

The built-in Drawing canvas plugin exposes the following APIs.

Drawing canvas instance APIs

async GetImagePixelData()

Takes a snapshot of the drawing canvas pixel state on the GPU, and reads it back to the CPU asynchronously. Resolves with an ImageData representing the pixel data. Note this uses unpremultiplied alpha, whereas the surface on the GPU is premultiplied, so technically this is lossy.