Click or drag to resize

Rectangle Methods

The Rectangle type exposes the following members.

Methods
  NameDescription
Public methodAlign(Size)
Aligns the rectangle to a grid of the specified gridSize
Public methodAlign(Int32, Int32)
Aligns the rectangle to a grid of the specified gridWidth and gridHeight
Public methodStatic memberAlign(Rectangle, Size)
Aligns the rectangle to a grid of the specified gridSize
Public methodStatic memberAlign(Rectangle, Int32, Int32)
Aligns the rectangle to a grid of the specified gridWidth and gridHeight
Public methodStatic memberCeiling
Converts a floating point rectangle to an integral Rectangle by getting the smallest integral value of X, Y, Width, and Height
Public methodContains(Point)
Gets a value indicating that the specified point is within the bounds of this rectangle
Public methodContains(Rectangle)
Gets a value indicating that the specified rectangle is entirely contained within the bounds of this rectangle
Public methodContains(Int32, Int32)
Gets a value indicating that the specified x and y co-ordinates are within the bounds of this rectangle
Public methodEquals(Object)
Compares this rectangle to an object for equality
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Rectangle)
Compares this rectangle with the specified other rectangle
Public methodStatic memberFromCenter
Creates a new instance of a Rectangle with a specified center and size
Public methodStatic memberFromSides
Creates a new instance of a RectangleF from the values of the left, top, right and bottom sides
Public methodGetHashCode
Gets the hash code for this rectangle
(Overrides ValueTypeGetHashCode.)
Public methodInflate(Size)
Inflates all dimensions of this rectangle by the specified size
Public methodInflate(Int32, Int32)
Inflates all dimensions of this rectangle by the specified width and height
Public methodStatic memberInflate(Rectangle, Size)
Inflates all dimensions of the rectangle by the specified size
Public methodStatic memberInflate(Rectangle, Int32, Int32)
Inflates all dimensions of this rectangle by the specified width and height
Public methodIntersect(Rectangle)
Intersect the rectangle with the specified rectangle
Public methodStatic memberIntersect(Rectangle, Rectangle)
Intersect the two specified rectangles
Public methodIntersects
Gets a value indicating that the specified rectangle overlaps this rectangle
Public methodNormalize
Normalizes the rectangle so both the Width and Height are positive, without changing the location of the rectangle
Public methodOffset(Point)
Offsets the location of the rectangle by the X and Y values of the specified point
Public methodOffset(Size)
Offsets the location of the rectangle by the specified size
Public methodOffset(Int32, Int32)
Offsets the location of the rectangle by the specified x and y values
Public methodStatic memberOffset(Rectangle, Point)
Offsets the location of the rectangle by the X and Y values of the specified point
Public methodStatic memberOffset(Rectangle, Size)
Offsets the location of the rectangle by the specified size
Public methodStatic memberOffset(Rectangle, Int32, Int32)
Offsets the location of the rectangle by the specified x and y values
Public methodRestrict(Rectangle)
Restricts the rectangle to be within the specified rectangle
Public methodRestrict(Size)
Restricts the rectangle to be within the specified size at an X,Y location of 0, 0
Public methodRestrict(Point, Size)
Restricts the rectangle to be within the specified location and size
Public methodStatic memberRestrict(Rectangle, Rectangle)
Restricts the rectangle to be within the restrict rectangle
Public methodStatic memberRestrict(Rectangle, Size)
Restricts the rectangle to be within the specified size
Public methodStatic memberRound
Converts a floating point rectangle to an integral Rectangle by rounding the X, Y, Width, and Height.
Public methodToString
Converts this rectangle to a string
(Overrides ValueTypeToString.)
Public methodStatic memberTruncate
Converts a floating point rectangle to an integral Rectangle by truncating the X, Y, Width, and Height values
Public methodUnion(Rectangle)
Union the rectangle into this instance to encompass both rectangles
Public methodStatic memberUnion(Rectangle, Rectangle)
Combines two rectangles into one rectangle that encompasses both
Top
See Also