Skip to content
Advertisement

How do I know when canvas finish drawing?

I have a large image draw by canvas and I want to know when canvas finishes drawing.

Advertisement

Answer

canvas drawing in synchronous so when you draw like this

 canvas.getContext('2d').fillRect(25, 25, 100, 100);

the next line get excuted when the drawing is finished so you can do what you wanted to do after drawing like this

canvas.getContext('2d').fillRect(25, 25, 100, 100);
//draw finished do something
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement