var canvas = null; var context = null; setup = function(){ canvas = document.getElementById("my_canvas"); context = canvas.getContext('2d'); canvas.width = window.innerWidth; canvas.height = window.innerHeight; // var img = document.getElementById("scream"); // ctx.drawImage(img,10,10); img = new Image(); img.onload = onImageLoad; img.src = "ralphyrobot.png"; }; onImageLoad = function(){ console.log("IMAGE!!"); };
onImageLoad
var onImageLoad = function(){ console.log("IMAGE!!!"); context.drawImage(img,192,192) };