Why its not possible to draw images on canvas using boxes class. I have tried but its not working. Added below code in draw method but its not showing anything. neither there are any error
var img = new Image();
img.onload = function(){
canvas.width = img.width;
canvas.height = img.height;
ctx.drawImage(img, 0, 0, 50, 50);
}
img.src = 'cottage.jpg';