Web Workers and Canvas(网络工作者和画布)
问题描述
是否允许网络工作者访问画布对象?
Are web workers allowed to access a canvas object?
推荐答案
小更新,问题到现在半年多了:
Small update, as the question is now more than half a year old:
在 Chrome/Chromium 6 中,您现在可以将画布的 ImageData 对象发送给网络工作者,让网络工作者对对象进行更改,然后使用 putImageData(..) 将其写回画布.
In Chrome/Chromium 6 you can now send a canvas' ImageData object to a web worker, let the web worker make changes to the object and then write it back to the canvas using putImageData(..).
Google 的 Chromabrush 就是这样做的,源代码可以在这里找到:
Google's Chromabrush does it this way, the source-code can be found here:
- 主线程李>
- 网络工作者李>
更新:
Opera (10.70) 和 Firefox (4.0b1) 的最新开发快照也支持将 ImageData 对象传递给 web worker.
The latest development snapshots of Opera (10.70) and Firefox (4.0b1) also support passing ImageData objects to a web worker.
2017 年更新:
来自 Github 的实际链接(从 Chromabrush 更容易找到所需的文件):
Actual links from Github (easier to find needed files from Chromabrush):
- 向工作人员发送 imageData李>
- 接收数据
这篇关于网络工作者和画布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:网络工作者和画布
基础教程推荐
- 如何在特定日期之前获取消息? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
