Search code examples
c#wpfdoublepoint

Best practice for double coordinates for Point


There is System.Drawing.Point which accepts int values for X and Y coordinate paramenters.
This is not what I need.

Then there is System.Windows.Point which accepts double values for X and Y. This is what I'd need, however I am not sure if this is the structure I should be using in a class library project.

Lastly, I found System.Drawing.PointF, but it accepts float values for X and Y coordinate parameters. I'd prefer to use double.

What is the best practice?

Further clarification:

Basically, I have a WPF project and a Class Library project, which serves as a model to the UI. I need to remember Rectangle coodinates (double, double) in the model.


Solution

  • If you do not use anything else from System.Drawing or System.Windows implement your own PointD which uses double values. I also did that in a previous project... shouldn't be a big deal.