Image crop after rotate by canvas

前端 未结 3 996
庸人自扰
庸人自扰 2020-12-09 14:10

I have a html5 canvas. I want to draw/rotate the image in the canvas and image size does not change.I set width/height of canvas base on size of image.I have a problem to r

3条回答
  •  渐次进展
    2020-12-09 14:50

    change the parameter of drawImage

    ctx.drawImage(image, -image.width / 2, -image.height/ 2);
    

提交回复
热议问题