我正在做一個用戶控件內的橢圓中的rotationTransform
和scaleTransform
。 我已經試過這個,但沒有工作。如何獲得FrameworkElement的真實位置?
Point myUiElementPosition =
ellipse.TransformToAncestor(this.Parent as Panel).Transform(new Point(0, 0));
我用鼠標旋轉對象,但上面的代碼總是返回相同的值!
我在做什麼錯?我已經試過把App.Current.MainWindow
而不是this.Parent as Panel
。
我也嘗試使用this
而不是ellipse
。
幫助!
你使用RenderTransform還是LayoutTransform? – LPL 2012-07-16 15:30:31
我使用renderTransform。我想它確實有所作爲。 – Seva 2012-07-16 18:55:47