0

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.

I was reading this post

Data URI leak in Safari (was: Memory Leak with HTML5 canvas)

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.

This post

Data URI leak in Safari (was: Memory Leak with HTML5 canvas)

refers to "creating a pixel data array and writing it to the canvas with putImageData" however there is no code to support this.

How can I create a pixel data array from my bitmap data ?

Basically I want to draw my bitmap data on the canvas, by using putImageData.

Thank you.

Community
  • 1
  • 1
G-Man
  • 7,232
  • 18
  • 72
  • 100

1 Answers1

0

May be this you would found useful. Link.
If this is not what you were looking for then elaborate a little more about your query,
i will surely try to help.

Vijay
  • 563
  • 1
  • 6
  • 18