HTML5 canvas drawImage with at an angle
问题 I am experimenting with animation in <canvas> and can't work out how to draw an image at an angle. The desired effect is a few images drawn as usual, with one image rotating slowly. (This image is not at the centre of the screen, if that makes any difference). 回答1: You need to modify the transformation matrix before drawing the image that you want rotated. Assume image points to an HTMLImageElement object. var x = canvas.width / 2; var y = canvas.height / 2; var width = image.width; var