canvas drawImage

本来是写头像截取的,由于参数弄错了搞半天没写对...记一下...

语法

CanvasRenderingContext2D.drawImage()

ctx.drawImage(image, dx, dy);

ctx.drawImage(image, dx, dy, dWidth, dHeight);

ctx.drawImage(image, sx, sy, sWidth, sHeight......