Namespace TallComponents.Interaction
Class Rectangle
A rectangular area in a 2-dimensional coordinate system.
The width and height of a rectangle are always greater than or equal to zero. The position of the rectangle - i.e. its origin - is always chosen so that this requirement is met. It depends on the coordinate system whether the origin is at the "top left" of the rectangle or elsewhere.
Syntax
public class Rectangle : Object
Constructors
Rectangle()
Create an empty rectangle at position (0,0).
Rectangle(Double,Double,Double,Double)
Create new rectangle at the given position and with the specified
width and height.
Rectangle(Double,Double,Double,Double,Transform)
Create a rectangle with the given position and size, and apply the given transformation to it.
Rectangle(Rect)
Create a rectangle from a Rect.
Rectangle(Rectangle)
Create a rectangle from a Rectangle.
Rectangle(Rectangle,Transform)
Create a rectangle from an existing rectangle.
Properties
Double Height
Height of the rectangle
Double Width
Width of the rectangle
Double X
X coordinate of the rectangle
Double Y
Y coordinate of the rectangle
Methods
Boolean Contains(Point)
Tests whether the given coordinate is inside the rectangle.
Boolean Contains(Rectangle)
Tests whether the given rectangle is contained in this one.
Rectangle CreateGdiRectangle()
Converts the rectangle to the System.Drawing.Rectangle equivalent
RectangleF CreateGdiRectangleF()
Converts the rectangle to the System.Drawing.RectangleF equivalent
Rect CreateWpfRectangle()
Converts the rectangle to the System.Windows.Rect equivalent
Boolean Equals(Object)
Returns true if the argument object equals this rectangle.
Int32 GetHashCode()
Returns the hash code for this instance.
Boolean IntersectsWith(Rectangle)
Tests whether the given rectangle intersects with this one.