mirror of
https://github.com/openstf/stf
synced 2025-10-05 19:42:01 +02:00
Add Canvas Render.
This commit is contained in:
parent
168590a1b7
commit
aa28801e87
4 changed files with 51 additions and 0 deletions
16
res/app/components/stf/screen/image-render/canvas/index.js
Normal file
16
res/app/components/stf/screen/image-render/canvas/index.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue