Property:
drawImage:
img,10,10,220,50
img,10,10,220,100
img,10,10,220,150
img,10,10,220,200
img,10,10,220,250
img,10,10,220,277
img,10,10,220,300
img,10,10,220,350
img,10,10,220,400
Canvas:
your browser does not support the canvas tag
Code:
var img = document.createElement('img');
img.src = 'img_the_scream.jpg';
img.onload = function () {
const c = document.getElementById('myCanvas');
const ctx = c.getContext('2d');
ctx.drawImage(
img, 10, 10, 220, 277)
;
}
Click the property values above to see the result
W3Schools.com
- Play it