This documentation is archived and is not being maintained.

Rect Members

Describes the width, height, and location of a rectangle.

The following tables list the members exposed by the Rect type.

  Name Description
Public method Rect Overloaded. Initializes a new instance of the Rect structure.
Top

  Name Description
Public property Bottom Gets the y-axis value of the bottom of the rectangle (Y + Height).
Public property BottomLeft Gets the coordinates of the bottom left corner of the rectangle
Public property BottomRight Gets the coordinates of the bottom right corner of the rectangle.
Public property Static Empty Gets the Empty rectangle, a special value that represents a rectangle with no position or area.
Public property Height Gets or sets the height of this rectangle.
Public property IsEmpty Gets a value that indicates whether this rectangle is the Empty rectangle.
Public property Left Gets the x-axis position of the left side of the rectangle. Getting this property is equivalent to getting the rectangle's X property.
Public property Location Gets or sets the position of the rectangle's top-left corner.
Public property Right Gets the x-axis value of the right side of the rectangle.
Public property Size Gets or sets the Width and Height of the rectangle.
Public property Top Gets the y-axis position of the top of the rectangle, which is equal to Y.
Public property TopLeft Gets the position of the top-left corner of the rectangle, which is equivalent to (X, Y).
Public property TopRight Gets the position of the top-right corner of the rectangle, which is equivalent to (X + Width, Y).
Public property Width Gets or sets the width of the rectangle.
Public property X Gets or sets the location of the rectangle's left side.
Public property Y Gets or sets the location of the rectangle's top side.
Top

(see also Protected Methods )
  Name Description
Public method Contains Overloaded. Determines whether this rectangle contains the specified point or rectangle.
Public method Equals Overloaded. Overridden. Determines whether the specified rectangles are equal.
Public method GetHashCode Overridden. Creates a hash code from this rectangle's X, Y, Width, and Height values.
Public method GetType  Gets the Type of the current instance. (inherited from Object)
Public method Inflate Overloaded. Expands or contracts the rectangle by the specified amount.
Public method Intersect Overloaded. Finds the intersection of two rectangles and stores the result as a Rect structure.
Public method IntersectsWith Indicates whether the specified rectangle intersects with this rectangle.
Public method Offset Overloaded. Translates the rectangle by the specified amount.
Public method Static op_Equality Compares two rectangles for exact equality.
Public method Static op_Inequality Compares two rectangles for inequality.
Public method Static Parse Converts a String representation of a rectangle into the equivalent Rect structure.
Public method Static ReferenceEquals  Determines whether the specified Object instances are the same instance. (inherited from Object)
Public method Scale Multiplies the size of the current rectangle by the specified x and y value.
Public method ToString Overloaded. Overridden. Creates a String representation of this rectangle.
Public method Transform Overloaded. Transforms a rectangle using the specified matrix.
Public method Union Overloaded. Expands a rectangle exactly enough to contain the specified rectangle or point.
Top

  Name Description
Protected method Finalize  Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (inherited from Object)
Protected method MemberwiseClone  Creates a shallow copy of the current Object. (inherited from Object)
Top

  Name Description
Explicit interface implementation Method System.IFormattable.ToString This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.
Top
Show: