Skip to content

@fabwcie/free-drawing / utils/export / renderCanvas

Function: renderCanvas() ​

renderCanvas(shapes, box, options?): HTMLCanvasElement

Defined in: packages/free-drawing/src/utils/export.ts:123

Shapes rendered on a canvas (png, pdf, clipboard), same rendering as drawer: clones of shapes in a stage out of page, titles of frames hidden

Parameters ​

shapes ​

DrawingShape[]

exported shapes, bottom first (shapes of groups placed as drawn)

box ​

Box

Exported area (see getExportBox)

options? ​

ImageOptions = {}

background, dark mode colors and pixel ratio

Returns ​

HTMLCanvasElement

canvas of box size multiplied by scale