Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 473
Sir Avatar asked May 31 '26 03:05

Sir


1 Answers

You should not have the .src.

ctx.drawImage(logoImg, 0, 0);
like image 58
epascarello Avatar answered Jun 01 '26 18:06

epascarello



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!