<canvas id="myCanvas" width="500" height="300"></canvas>
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
var imgObject = new Image();
imgObject.src = "https://tools.wingzero.tw/assets/upload/1579846830988_0.jpg";
imgObject.addEventListener('load',function(){
context.drawImage(imgObject,0,0, 500, 300);
})
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.