开发者

Document-free canvas for Web Worker

开发者 https://www.devze.com 2023-03-27 07:39 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消