Property:
drawImage:
img,90,10,50,60,10,10,50,60
img,90,30,50,60,10,10,50,60
img,90,50,50,60,10,10,50,60
img,90,70,50,60,10,10,50,60
img,90,90,50,60,10,10,50,60
img,90,110,50,60,10,10,50,60
img,90,130,50,60,10,10,50,60
img,90,150,50,60,10,10,50,60
img,90,170,50,60,10,10,50,60
Canvas:
your browser does not support the canvas tag
Code:
var img=document.createElement('img');
img.src='img_the_scream.jpg';
img.onload = function () {
var c=document.getElementById('myCanvas');
var ctx=c.getContext('2d');
ctx.drawImage(
img,90,130,50,60,10,10,50,60)
;
}
Click the property values above to see the result
W3Schools.com
- Play it