Kind: global class
Npmpackage:
Utilities for Canvas DOM elements
import { CanvasUtils } from 'ad-canvas'
Gets the image data associated with a canvas
Kind: static method of CanvasUtils
Param | Type | Description |
---|---|---|
source | canvas | UICanvas | CanvasDrawer |
a CANVAS DOM element or CanvasDrawer from whcih to get image data |
Example
CanvasUtils.getImageData(_myCanvas)
Applies image data to a canvas.
Kind: static method of CanvasUtils
Param | Type | Description |
---|---|---|
target | canvas | UICanvas | CanvasDrawer |
a CANVAS DOM element or CanvasDrawer to apply image data |
data | array |
the image data to apply to the canvas |
Example
var _imageData = CanvasUtils.getImageData(_sourceCanvas)
CanvasUtils.setImageData(_targetCanvas, _imageData)