Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
I want to create a point structure by supplying double values to the x and y parameters of a point structure.Not a single constructor supports this. so, how to do this?
I want to achieve,
C#
double x;
            double y;
            Point p1 = new Point(x, y);


But unfortunately I couldn't get it.

What I have tried:

I did google search & found This link relevant to my question. As per that, I added reference to WindowsBase.dll but couldn't be able to include it by using statement. Please,help me.
Posted
Updated 8-Mar-19 2:11am
v2

1 solution

Use a the Point class in System.Windows instead. It's constructor accepts double parameters.
 
Share this answer
 
Comments
TheRealSteveJudge 8-Mar-19 8:23am    
5*! I only thought of System.Drawing...
#realJSOP 8-Mar-19 8:39am    
That's the PointF class, and it only takes floats.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900