Home
Sign Up
Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
V2EX
›
程序员
html canvas 使用getImageData时,chrome内存飙升,达300多M
zhfsxtx
·
Jun 22, 2013
· 3857 views
This topic created in 4904 days ago, the information mentioned may be changed or developed.
当我的canvas大小大到2000*4000,使用
ctx.getImageData(0,0,canvas.width,canvas.height)
chrome内存会飙升到300多M 有没有什么办法让内存不吃的这么厉害?
canvas
内存
getImageData
3 replies
•
1970-01-01 08:00:00 +08:00
switch
Jun 22, 2013
1
2000 * 4000 * 4 = 32000000。
要么不要使用 getImageData,要么使用 getImageData 时,不要获取整个 canvas 的 ImageData,只获取需要区域的 ImageData。
zhfsxtx
OP
Jun 22, 2013
2
@
switch
可以是我就是做获取整个canvas 的ImageData来处理,只获取需要区域的 ImageData?
难道是要把整个canvas 分成若干个区域,再分开获取,再后拼起来处理?
linuz
Jun 22, 2013
3
try this
http://ajaxian.com/archives/canvas-image-data-optimization-tip
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
3469 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms ·
UTC 10:06
·
PVG 18:06
·
LAX 02:06
·
JFK 05:06
♥ Do have faith in what you're doing.
❯