commented regarding adding image to canvas

This commit is contained in:
Karan
2022-01-03 17:27:58 +05:30
committed by GitHub
parent cd6a335def
commit a11f698fb1
@@ -15,7 +15,7 @@
canvas.height = 300; canvas.height = 300;
canvas.width = 300; canvas.width = 300;
let ctx = canvas.getContext("2d"); let ctx = canvas.getContext("2d");
let myImage = document.getElementById("flower"); let myImage = document.getElementById("flower"); //This line adds the image on the canvas, you can hide the <img> tag by " style="display: none;" "
ctx.drawImage(myImage, 10, 10); ctx.drawImage(myImage, 10, 10);
}; };
</script> </script>