I have a problem. I am trying to draw an image onto a canvas. The image is not from the HTML page, but on a file. Here is the code i use:
var img = new Image
You need to wait for the image to load before attempting to draw it into a canvas:
var img = new Image(); img.src = "/images/logo.jpg"; img.onload = function () { this._canvas.drawImage(img, 300, 300);// this is line 14 }