HTML5 Canvas: Get Event when drawing is finished

Like almost all Javascript functions, drawImage is synchronous, i.e. it’ll only return once it has actually done what it’s supposed to do.

That said, what it’s supposed to do, like most other DOM calls, is queue-up lists of things to be repainted next time the browser gets into the event loop.

There’s no event you can specifically register to tell you when that is, since by the time any such event handler could be called, the repaint would have already happened.

Leave a Comment