Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

draw-to-canvas

1.0.0 • Public • Published

draw-to-canvas

draw from one canvas to another with some sanity checks

Build Status npm version

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install draw-to-canvas --save

Usage

var moduleName = require('draw-to-canvas');
 
let canvas1 = document.createElement('canvas')
let canvas2 = document.createElement('canvas')
 
// draw from canvas1 to canvas2
drawToCanvas(canvas1, canvas2) // canvasTo
 
// draw from canvas1 to canvas2 at different origin
drawToCanvas(canvas1, canvas2, [20, 30]) // canvasTo

API

drawToCanvas(from:canvas/image, to:canvas/ctx, pos:arr)

Arguments

  • from - a canvas element or image
  • to - a canvas element or canvas context

License

MIT

Install

npm i draw-to-canvas

DownloadsWeekly Downloads

6

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar