title: Canvas How to convert getImageData to toDataUrl format
body: <p>How to convert getImageData to todataUrl</p>
  
  <pre><code>code lines: 
  var data = ctx.getImageData(150,200,200,100);
  var data = document.getElementById("canvas").toDataURL('image/gif');
  </code></pre>
  
  <p>First situation: 1 parameter x space, 2 y space, 3 and 4 x,y example image: <code>http://postimg.org/image/lfogtwjn7/</code> so i got croped image data 200px x 100px
  Second situation i get full image toDataUrl: <code>document.getElementById("canvas").toDataURL('image/gif');</code></p>
  
  <p><strong>How i can get cropped image like a <code>getImageData(150,200,200,100)</code> but toDataUrl format</strong>
  Maybe somebody have other offer</p>