Skip to main content
Module

x/skia_canvas/mod.ts>SvgCanvas

Fast HTML Canvas API implementation for Deno using Google Skia
Latest
class SvgCanvas
import { SvgCanvas } from "https://deno.land/x/skia_canvas@0.5.6/mod.ts";

A canvas that can be used to render SVG.

Make sure to call complete() when you are done drawing. Only call save() or encode() after calling complete(), once.

Constructors

new
SvgCanvas(
width: number,
height: number,
options?: SvgCanvasOptions,
)

Methods

In order to complete the SVG, you must call this method. Call it only once before saving or encoding.

Encode and return buffer containing SVG data

Obtain 2D context for drawing on SVG

save(path: string)

Save SVG on file system

Convert to SVG string