I need to draw an image with a certain angle on a canvas, it need to rotate angle N , and its center is on 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);
But I find the img rotate by the top left corner, I need the image rotate with its center. How can I do this? many thanks!