Document-free canvas for Web Worker
Is there any implementation of canvas without document.createElement('canvas')
?
I want to work with canvas in web worker but i can't pass canvas data to it via worker.postMessage()
, because canvas is HTMLElement.
var canvas = document.createElement('canvas'), worker = new Worker('canvas.js');
worker.postMessage(canvas.getData())开发者_高级运维;
Also i don't want to pass canvas's ImageData to web worker because i don't want to implement context2d.drawImage()
manually.
Nope. Sorry, ImageData is your only recourse here.
精彩评论