title: Draw bitmap data on html5 canvas
body: <p>I am receiving base64 encoded bitmap data through sockets, I decoding this data using atob and now have the bitmap data ready to be drawn on an HTML5 canvas.</p>
  
  <p>I was reading this post</p>
  
  <p><a href="https://stackoverflow.com/questions/8538917/data-uri-leak-in-safari-was-memory-leak-with-html5-canvas">Data URI leak in Safari (was: Memory Leak with HTML5 canvas)</a></p>
  
  <p>and although I am able to draw my bitmap data on the canvas using context.drawImage(..) I am looking for a different approach, due to memory leaks when alling drawImage too many times.</p>
  
  <p>This post</p>
  
  <p><a href="https://stackoverflow.com/questions/8538917/data-uri-leak-in-safari-was-memory-leak-with-html5-canvas">Data URI leak in Safari (was: Memory Leak with HTML5 canvas)</a></p>
  
  <p>refers to "creating a pixel data array and writing it to the canvas with putImageData" however there is no code to support this.</p>
  
  <p>How can I create a pixel data array from my bitmap data ?</p>
  
  <p>Basically I want to draw my bitmap data on the canvas, by using putImageData.</p>
  
  <p>Thank you.</p>