我想繪製一條線,使用controlpaint.DrawReversibleLine方法,並試圖傳遞system.windows.point,但它希望system.drawing.point輸入。我有點困惑。他們之間有什麼不同?或者除了明顯的區別之外它們又有何不同?System.Windows.Point和System.Drawing.Point命名空間有什麼區別?
感謝,
我想繪製一條線,使用controlpaint.DrawReversibleLine方法,並試圖傳遞system.windows.point,但它希望system.drawing.point輸入。我有點困惑。他們之間有什麼不同?或者除了明顯的區別之外它們又有何不同?System.Windows.Point和System.Drawing.Point命名空間有什麼區別?
感謝,
System.Windows.Point
是WPF結構,而System.Drawing.Point
是一個WinForms結構。
一般情況下,如果你正在寫一個WinForms應用程序,該做任何的System.Windows
命名空間(除System.Windows.Forms
)不使用的東西。這些命名空間中的資源是WPF特有的,因此除非您打算與WPF和WinForms接口,否則最好避免它們。
System.Windows.Point
是爲WPF應用程序。
的System.Windows命名空間中包含的Windows Presentation Foundation(WPF)使用的類型的應用程序,包括動畫的客戶端,用戶接口控制,數據綁定,和類型轉換
System.Drawing.Point
旨在用於的WinForms應用。
System.Drawing命名空間提供對GDI +基本圖形功能的訪問。
可能重複[System.Drawing.Point和System.Windows.Point有什麼區別?](http://stackoverflow.com/questions/2659520/what-is-the-difference-between-system-繪圖點和系統窗口點) – nawfal