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
JavaScript
x
2
1
canvas.getContext('2d').fillRect(25, 25, 100, 100);
2
the next line get excuted when the drawing is finished so you can do what you wanted to do after drawing like this
JavaScript
1
3
1
canvas.getContext('2d').fillRect(25, 25, 100, 100);
2
//draw finished do something
3