I have a following problem: when I draw a rectangle (using fillRect method), and then I draw an image (using drawImage), I can't get correct result from Contex, by using getImageData. When I comment line with drawImage, it works correctly. Where is the problem?
var img=document.getElementById("img");
var canvas=document.getElementById("can");
var ctx=canvas.getContext('2d');
ctx.fillStyle="red";
ctx.fillRect(0,0,50,50);
ctx.drawImage(img, 0, 0, 19, 19); //;(
var imgData=ctx.getImageData(0,0,50,50);
ctx.putImageData(imgData,100,100);
Problem: http://jsfiddle.net/yX5mj/1/