3 ms·
Why not just do something like the below when you need to do that? var img = new Image(); img.onload = function(){ //draw to canvas }; img.src =
by de90 16y ago
Why not just do something like the below when you need to do that?
var img = new Image();
img.onload = function(){
//draw to canvas
};
img.src = "image.png";
Could be a stupid answer, or possibly it'd be better to do it your way?( Maybe I can learn something :) )