getImageData(), putImageData() not working on Nexus 4, using Cocoonjs canvas+ -


i'm writing small demo program test canvas+ performance. getimagedata(), putimagedata() don't seem work. leaves black square on canvas. half size in width , height, of course considering window.devicepixelratio 2, not compatible must exist somewhere. program works fine in chrome browser. won't work using cocoonjs launcher 2.1.1.

code:

i 'm using requestanimationframe(loop);  ctx.drawimage(origin_img,0,0,410, 180, 0, 0, width, height); texture = ctx.getimagedata(0,0,width,height);  loop{ ctx.clearrect(0,0,ctx.canvas.width,ctx.canvas.height); ctx.fillstyle = 'red'; ctx.fillrect(0,0,width, height); ctx.putimagedata(texture, 0, 0);  } 

the result is: can see red rectangle 1/4 size black rectangle on it. can me it?

ctx.drawimage() work in program.

==============================

thanks both! posted code at
http://spikeyang.boxshell.com/static/js/src.zip

please click 3rd link, water_ripple see result. please click top-right button go home page. main js file js/demo.js. main function waterrippleloop(). trying water ripple sim code.

i have used getimagedata , putimagedata in past , worked fine in canvas+. questions:

1.- have tested on android device (or ios device) using canvas+ , did work? 2.- provide whole example source code? simpler better.

regards, iker.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -