我可以使用此代碼獲得圖像座標。但我想通過使用Matrix來做同樣的操作。如何使用矩陣變換鼠標座標?
private int _angle = 90;
float scaleFactorX = (float)resizeWidth/(float)originalWidth;
float scaleFactorY = (float)resizeHeight/(float)originalHeight;
graphics.TranslateTransform((float)(width/2), (float)(height/2));
graphics.ScaleTransform(scaleFactorX, scaleFactorY);
graphics.RotateTransform(_angle);
graphics.TranslateTransform(-(float)originalWidth/2, -(float)originalHeight /2);
graphics.TransformPoints(System.Drawing.Drawing2D.CoordinateSpace.World, System.Drawing.Drawing2D.CoordinateSpace.Device, point);
謝謝大家提前。
@Shikha:anda fter將結果矩陣應用於圖形對象本身 – Tigran