Sir
Sir

Reputation: 8280

Type error on draw image function

For some reason i can't get my image to display in canvas.. i get a type error.

My script is very basic.. its this:

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

What does it mean when it says type error?

Upvotes: 3

Views: 1275

Answers (1)

epascarello
epascarello

Reputation: 207501

You should not have the .src.

ctx.drawImage(logoImg, 0, 0);

Upvotes: 3

Related Questions