You can convert the points to sizes and then use Size subtraction, but
have to deal with issues like did they drag from top/left to
bottom/right or reverse.
I think easiest is to just perform math separately and then create a
size structure from that:
height = Math.Abs(mousedownPoint.X - mouseupPoint.X);
width = Math.Abs(mousedownPoint.Y - mouseupPoint.Y);
Size sz = new Size(width, height);
Unless you want the sizes to be negative which is possible depending
on what you're going to do with the data...
HTH,
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On Thu, 15 Feb 2007 12:20:21 -0500, "Dan Reber" <dr****@nospam.com>
wrote:
>I have to Point variables that are being set on MouseDown and MouseUp
events --
mousedownPoint = new Point(e.X, e.Y);
mouseupPoint = new Point(e.X, e.Y);
Is there a way that I can take those two points and get a Height and Width
value from it to use for a Size variable? I have tried many different ways
but none of them have worked.
Thanks
Dan