How can I compare two points in C#?
-
Hi How can I compare two points in c#? For example, Point p1 = new Point(0, 0); Point p2 = new Point(20, 20); How do I p1 < p2 or p2 < p1? I know p1.equals(p2) to check whether both are equal. But how do I do <, >? Thanks in advance Muthu.
How do YOU define if a two-dimentional coordinate is less that (or greater than) another two-dimentional coordinate?
Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos
-
Hi How can I compare two points in c#? For example, Point p1 = new Point(0, 0); Point p2 = new Point(20, 20); How do I p1 < p2 or p2 < p1? I know p1.equals(p2) to check whether both are equal. But how do I do <, >? Thanks in advance Muthu.
The only thing you can really do is defining which is below or upper and left or right to the other. Is that what you want? The notion of comparing 2 points defined by 2 dimensions coordinates is inappropriate in the context.
David Domingues at webrickco@gmail.com. Feel free to visit http://webrick.athost.net/index.php
-
How do YOU define if a two-dimentional coordinate is less that (or greater than) another two-dimentional coordinate?
Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos
Basically, I have a panel in my form, and I want to capture whether my mouse is out of panel or inside panel. I dont want to use mouse_leave and mouse_enter. so, when I capture panel's top-left and bottom-right I need to compare it with mouse pointer's coordination. hope i explained clearly. Thanks Muthu.
-
Basically, I have a panel in my form, and I want to capture whether my mouse is out of panel or inside panel. I dont want to use mouse_leave and mouse_enter. so, when I capture panel's top-left and bottom-right I need to compare it with mouse pointer's coordination. hope i explained clearly. Thanks Muthu.
What's wrong with comparing the x and y coordinates of the points?
Wout
-
Hi How can I compare two points in c#? For example, Point p1 = new Point(0, 0); Point p2 = new Point(20, 20); How do I p1 < p2 or p2 < p1? I know p1.equals(p2) to check whether both are equal. But how do I do <, >? Thanks in advance Muthu.
is a point inside some rectangle ? such a popular question must have a very simple answer: bool Control.Bounds.Contains(Point) :)
Luc Pattyn