What is the difference between System.Drawing.Point and System.Windows.Point?

≡放荡痞女 提交于 2019-11-28 02:24:33

问题


  1. What's the difference between System.Drawing.Point and the System.Windows.Point?
  2. In what context should which one be used?

I'm working with WPF.


回答1:


System.Drawing.Point represents a GDI point and is used in Windows Forms. It can only hold integer values.

WPF doesn't use GDI anymore, so it has its own System.Windows.Point type to represents a point, which can have non integer values.




回答2:


One is used with the classes in System.Drawing namespaces, and one is used with WPF.

The System.Drawing.Point is not so surprisingly used with the classes in the System.Drawing namespaces. The System.Windows.Point is used with WPF.



来源:https://stackoverflow.com/questions/2659520/what-is-the-difference-between-system-drawing-point-and-system-windows-point

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!