1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 02:29:26 +02:00
OpenSTF/res/app/components/stf/screen/image-render/canvas/index.js
2014-02-19 23:55:08 +09:00

16 lines
366 B
JavaScript

function CanvasRender(options, canvasElement) {
this.options = options
this.context = canvasElement.getContext('2d')
}
CanvasRender.prototype.draw = function (image) {
this.context.drawImage(image, 0, 0)
}
CanvasRender.prototype.clear = function () {
var width = 300
var height = 300
ctx.clearRect(0, 0, width, height)
}
module.exports = CanvasRender