1
Q
WPF轉換運動
A
回答
0
從我所看到的,這是相當不平凡的。一般來說,你會想讓WPF爲你處理這種事情。
這就是說,這是我已經能夠想出,based on information from here。給定一個文本塊「textBlockName」:
HwndSource hwndSource = PresentationSource.FromVisual(textBlockName) as HwndSource;
Visual root = hwndSource.RootVisual;
// Translate the point from the visual to the root.
GeneralTransform transformToRoot = textBlockName.TransformToVisual(root);
Point p = new Point(0,0);
p = transformToRoot.Transform(p);
p = hwndSource.CompositionTarget.TransformToDevice.Transform(p) ;
//Display the top left point of the text box, after transforms.
MessageBox.Show(p.ToString());
編輯:這進一步看,我找不到更好的解決了這一點。不過,這似乎處理了我所能想到的所有情況。
相關問題
- 1. 動畫Wpf Windows轉換
- 2. WPF中的動畫轉換
- 3. 轉換在WPF
- 4. WPF轉換器結合 - 動態錯序
- 5. Wpf中的動態轉換器
- 6. WPF轉換屬性
- 7. WPF圖像轉換
- 8. WPF轉換錯誤
- 9. WPF轉換問題
- 10. WPF轉換問題
- 11. wpf內容轉換
- 12. 反向WPF轉換
- 13. WPF值轉換器
- 14. Silverlight轉換爲WPF轉換器
- 15. WPF翻轉動畫
- 16. WPF旋轉動畫
- 17. 用hammerjs,css轉換和轉換原點的手勢運動
- 18. WPF轉換器和字典
- 19. 轉換Windows窗體到WPF
- 20. WPF中的顏色轉換
- 21. WPF listview display轉換器
- 22. WPF轉換器指南
- 23. 將System.Drawing.Font.Size轉換爲WPF FontSize
- 24. 將MessageBoxImage轉換爲ImageSource WPF
- 25. WPF主題和轉換器
- 26. WPF轉換器從綁定
- 27. WPF綁定和轉換器
- 28. 將WPF轉換爲網格
- 29. WPF XAML轉換器錯誤
- 30. WPF MVVM圖轉換軸
事實上,我設法做到了而不用轉換。我使用自己的位圖旋轉等。 – Robbskinizer