README
draw-to-canvas
draw from one canvas to another with some sanity checks
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