title: Error when drawing Canvas Picture from base 64 String
body: <p>I want to draw a base64 String into a canvas bur I always get the error</p>
  
  <blockquote>
    <p>TypeError: Argument 1 of CanvasRenderingContext2D.drawImage could not be converted to any of: HTMLImageElement, HTMLCanvasElement, HTMLVideoElement.</p>
  </blockquote>
  
  <p>I did google it, but I still don't know what I did wrong.</p>
  
  <pre><code>var canvas = document.createElement('canvas');
  document.body.appendChild(canvas);
  var ctx = canvas.getContext("2d");
  var data =  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oMCRUiMrIBQVkAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADElEQVQI12NgoC4AAABQAAEiE+h1AAAAAElFTkSuQmCC";
  ctx.drawImage(data, 0, 0);
  </code></pre>
  
  <p><a href="http://jsfiddle.net/nikolang/ab00wae5/" rel="nofollow noreferrer">Here's a fiddle.</a></p>