2011-11-02 41 views
2

我想繪製一條線,使用controlpaint.DrawReversibleLine方法,並試圖傳遞system.windows.point,但它希望system.drawing.point輸入。我有點困惑。他們之間有什麼不同?或者除了明顯的區別之外它們又有何不同?System.Windows.Point和System.Drawing.Point命名空間有什麼區別?

感謝,

+1

可能重複[System.Drawing.Point和System.Windows.Point有什麼區別?](http://stackoverflow.com/questions/2659520/what-is-the-difference-between-system-繪圖點和系統窗口點) – nawfal

回答

6

System.Windows.Point是WPF結構,而System.Drawing.Point是一個WinForms結構。

一般情況下,如果你正在寫一個WinForms應用程序,該做任何的System.Windows命名空間(除System.Windows.Forms)不使用的東西。這些命名空間中的資源是WPF特有的,因此除非您打算與WPF和WinForms接口,否則最好避免它們。

4
  • System.Windows.Point是爲WPF應用程序。

    的System.Windows命名空間中包含的Windows Presentation Foundation(WPF)使用的類型的應用程序,包括動畫的客戶端,用戶接口控制,數據綁定,和類型轉換

  • System.Drawing.Point旨在用於的WinForms應用。

    System.Drawing命名空間提供對GDI +基本圖形功能的訪問。

相關問題