Type error for the image drawing function

For some reason I am unable to get my image to display in the canvas. I am getting an error like.

My script is very simple .. its this:

var logoImg = new Image();
logoImg.src = 'splash.png';
    ctx.drawImage(logoImg.src, 0, 0);

      

What does it mean when it says a type error?

+3


source to share


1 answer


You shouldn't have .src

.



ctx.drawImage(logoImg, 0, 0);

      

+3


source







All Articles