次のコード行があります。値(度数)がわからないまま、長方形にいくつかの回転を適用しました。次に、要素の回転または角度を2Dで取得します。
Rectangle element = (Rectangle)sender;
MatrixTransform xform = element.RenderTransform as MatrixTransform;
Matrix matrix = xform.Matrix;
third.Content = (Math.Atan(matrix.M21 / matrix.M22)*(180/Math.PI)).ToString();
and the matrix is like following
|M11 M12 0|
|M21 M22 0|
|dx dy 1| which is Transformation Matrix I guess !!
これは正しい値ではないようです。0度から360度の角度を取得したい