API Documentation
Documentation for the key classes and their attributes is listed below—properties are printed in bold and methods have parentheses attached to the name. The instances where Skia Canvas’s behavior goes beyond the standard are marked by a 🧪 symbol, linking to further details below. Links to documentation for the web standards Skia Canvas emulates are marked with a 📖.
The library exports a number of classes emulating familiar browser objects including:
- Canvas / extensions 🧪
- CanvasGradient / extensions 🧪
- CanvasPattern
- CanvasRenderingContext2D / extensions 🧪
- DOMMatrix
- Image / extensions 🧪
- ImageData / extensions 🧪
- Path2D / extensions 🧪
In addition, the module contains:
- FontLibrary a global object for inspecting the system’s fonts and loading additional ones
- Window a class allowing you to display your canvas interactively in an on-screen window
- App a helper class for coordinating multiple windows in a single script
- loadImage() a utility function for loading
Imageobjects asynchronously - loadImageData() a utility function for loading
ImageDataobjects asynchronously - loadCanvas() a utility function for creating
Canvasobjects from asynchronously loaded images
For detailed notes on the extensions Skia Canvas has made to standard object types, see the corresponding pages:
App
Global window manager and process controller
Canvas
An emulation of the HTML <canvas> element
CanvasRenderingContext2D
The drawing API for a particular Canvas
FontLibrary
Inspect your system fonts or load new ones
Image
Bitmap & vector image container
ImageData
Direct pixel access to image and canvas contents
Path2D
Bézier path construction & editing
Window
Display a canvas in a window and handle UI events