① 在画布上定位图像:context.drawImage(img,x,y)
② 在画布上定位图像,并规定图像的宽度和高度:context.drawImage(img,x,y,width,height)
③ 剪切图像,并在画布上定位被剪切的部分:context.drawImage(img,sx,sy,swidth,sheight,x,y,width,height)

① 在画布上定位图像:context.drawImage(img,x,y)
② 在画布上定位图像,并规定图像的宽度和高度:context.drawImage(img,x,y,width,height)
③ 剪切图像,并在画布上定位被剪切的部分:context.drawImage(img,sx,sy,swidth,sheight,x,y,width,height)