canvaskit-wasm 0.39
build 2026-04-29
PictureRecorder
The thing that makes a Picture. beginRecording(bounds) returns a recording Canvas you draw into; finishRecordingAsPicture() returns the resulting Picture. The recorder itself can be deleted once the picture is captured.
PictureRecorder is a WASM object — .delete() when done.
const recorder = new CK.PictureRecorder();
const recCanvas = recorder.beginRecording(CK.LTRBRect(0, 0, 200, 200));
// ... draw into recCanvas ...
const pic = recorder.finishRecordingAsPicture();
recorder.delete();
// pic.delete() when finally done.
Members
| Member | Args | Returns | Notes |
|---|---|---|---|
beginRecording | bounds: Rect | Canvas | Start recording. bounds hints at the maximum draw extent for optimization. |
delete | — | void | Free the WASM memory. |
finishRecordingAsPicture | — | Picture | Stop recording and return the picture. Caller deletes the picture. |
See also
Picture— the result.Canvas.drawPicture.