【问题标题】:What is the difference between System.Windows.Point and System.Drawing.Point namespace?System.Windows.Point 和 System.Drawing.Point 命名空间有什么区别?
【发布时间】:2011-11-02 15:21:19
【问题描述】:

我想使用 controlpaint.DrawReversibleLine 方法绘制一条线并尝试传递 system.windows.point,但它需要 system.drawing.point 输入。我有点困惑。它们之间有什么区别?或者除了明显的差异之外,它们还有什么不同?

谢谢,

【问题讨论】:

标签: .net winforms namespaces drawing delphi-prism


【解决方案1】:

System.Windows.Point 是 WPF 结构,而System.Drawing.Point 是 WinForms 结构。

一般来说,如果您正在编写 WinForms 应用程序,不要使用来自任何 System.Windows 命名空间的内容(System.Windows.Forms 除外)。这些命名空间中的资源是特定于 WPF 的,因此除非您打算连接 WPF 和 WinForms,否则最好避免使用它们。

【讨论】:

    【解决方案2】:
    • System.Windows.Point 适用于 WPF 应用程序。

      System.Windows 命名空间包含在 Windows Presentation Foundation (WPF) 应用程序中使用的类型,包括动画客户端、用户界面控件、数据绑定和类型转换

    • System.Drawing.Point 适用于 WinForms 应用程序。

      System.Drawing 命名空间提供对 GDI+ 基本图形功能的访问。

    【讨论】:

      猜你喜欢
      • 2011-04-13
      • 1970-01-01
      • 2014-08-10
      • 2012-07-10
      • 2011-12-10
      • 2012-01-01
      • 2014-09-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多