Rectangle function

rbulph

Junior Contributor
Joined
Feb 17, 2003
Messages
397
Is there a built in function that will take two rectangles and return the smallest rectangle that contains them both? I've looked under the Rectangle object and can't find anything. I can do:


With Rectangle2
R = Rectangle.FromLTRB(Min(R.Left, .Left), Min(R.Top, .Top), Max(R.Right, .Right), Max(R.Bottom, .Bottom))
End With

But it's a bit long-winded.
 
Thanks, I knew it had to be there somewhere.

I see this forum now has some sort of contextual advertising. My use of the word "long-winded" seems to have led to an offer for $300 free at CaesarsPalace.com. How kind of them!
 
Back
Top