title: draw image on canvas
body: <p>I am trying to put an image on a canvas. I read the following tutorial 
  <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial/Using_images" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial/Using_images</a> 
  and tried to do something similar to it
  my canvas is <code>&lt;canvas id="canvas" width="400" height="400"&gt;&lt;/canvas&gt;</code>
  and I have created the function</p>
  
  <pre><code>  function putImage(){
           var img = new Image();
           img.src = "./path.png"; 
           var ctx = document.getElementById('canvas').getContext('2d');
           ctx.drawImage(img,8,8);            
    }
  </code></pre>
  
  <p>but the image is not appearing on the canvas.
  I have printed the image path and it is correct, so I was able to eliminate this issue.
  any suggestions?</p>
  
  <p>thanks</p>