我需要在画布上绘制一定角度的图像,它需要旋转角度 N ,它的中心在 x, y
Matrix myPathMatrix;
myPathMatrix.Translate(x, y, MatrixOrderAppend);
myPathMatrix.Rotate(angle, MatrixOrderAppend);
canvas->SetTransform(&myPathMatrix);
Draw(canvas);// draw the image
myPathMatrix.Rotate(-angle, MatrixOrderAppend);
myPathMatrix.Translate(-x, -y, MatrixOrderAppend);
canvas->SetTransform(&myPathMatrix);
但我发现 img 在左上角旋转,我需要图像以其中心旋转。我怎样才能做到这一点?非常感谢!