title: HTML Canvas imageData array all 0's
body: <pre><code>    var img, imageData,width,height; 
      var c = canvasEle.getContext("2d");
      width = canvasEle.width;
      height = canvasEle.height;
  
      img = document.getElementById("id");
      c.drawImage(img,0,0);
      imageData = c.createImageData(width, height);
  </code></pre>
  
  <p>After I draw the image onto the context, then create an imageData array, the values of the array are all 0. </p>
  
  <p>I have been struggling with this for hours and couldn't find any solution. The image is shown on the canvas after I draw it, but the imageData of the context says all the pixels are white. This doesn't make any sense to me.</p>