@pencil.js/offscreen-canvas

1.18.0 • Public • Published

OffScreenCanvas

Utility to render on a non displayed canvas and extract data from it.

Installation

npm install @pencil.js/offscreen-canvas

Examples

import OffScreenCanvas from "@pencil.js/offscreen-canvas";

const circle = new Circle([0, 0], radius);
const offScreen = new OffScreenCanvas(width, height);

offScreen.render(circle);
// or
circle.render(offScreen);

const imageData = offScreen.imageData;

OffscreenCanvasOptions

Inherit from ContainerOptions.

Name Type Default Comment
fill Color or String null Background color
opacity Number 1 Global opacity

Readme

Keywords

Package Sidebar

Install

npm i @pencil.js/offscreen-canvas

Weekly Downloads

3

Version

1.18.0

License

MIT

Unpacked Size

8.6 kB

Total Files

4

Last publish

Collaborators

  • gmartigny