title: importing image on canvas html5
body: <pre class="lang-js prettyprint-override"><code>var img = new Image();
  img.src = '/images/backdrop.jpg';
  ctx.drawImage(img,0,0);
  </code></pre>
  
  <p>I wanted to load an image from local disk on to canvas using dialog box mechanism rather than the path directly specified as in above example. I tried different sorts using JavaScript but in vain, even tried using the input type as file. What else can I try?</p>