Rect Rect Rect Rect Struct

Definition

Describes the width, height, and point origin of a rectangle.

public value class Rect : IFormattable
[System.Security.SecurityCritical]
public struct Rect : IFormattable
type Rect = struct
    interface IFormattable
Public Structure Rect
Implements IFormattable
Inheritance
Attributes
Implements

Constructors

Rect(Point, Point) Rect(Point, Point) Rect(Point, Point) Rect(Point, Point)

Initializes a Rect struct that is exactly large enough to contain the two specified points.

Rect(Point, Size) Rect(Point, Size) Rect(Point, Size) Rect(Point, Size)

Initializes a Rect struct based on an origin and size.

Rect(Double, Double, Double, Double) Rect(Double, Double, Double, Double) Rect(Double, Double, Double, Double) Rect(Double, Double, Double, Double)

Initializes a Rect struct that has the specified x-coordinate, y-coordinate, width, and height.

Properties

Bottom Bottom Bottom Bottom

Gets the y-axis value of the bottom of the rectangle.

Empty Empty Empty Empty

Gets a special value that represents a rectangle with no position or area.

Height Height Height Height

Gets or sets the height of the rectangle.

IsEmpty IsEmpty IsEmpty IsEmpty

Gets a value that indicates whether the rectangle is the Empty rectangle.

Left Left Left Left

Gets the x-axis value of the left side of the rectangle.

Right Right Right Right

Gets the x-axis value of the right side of the rectangle.

Top Top Top Top

Gets the y-axis position of the top of the rectangle.

Width Width Width Width

Gets or sets the width of the rectangle.

X X X X

Gets or sets the x-axis value of the left side of the rectangle.

Y Y Y Y

Gets or sets the y-axis value of the top side of the rectangle.

Methods

Contains(Point) Contains(Point) Contains(Point) Contains(Point)

Indicates whether the rectangle described by the Rect contains the specified point.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Indicates whether the specified object is equal to the current Rect.

Equals(Rect) Equals(Rect) Equals(Rect) Equals(Rect)

Indicates whether the specified Rect is equal to the current Rect.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Creates a hash code for the Rect.

Intersect(Rect) Intersect(Rect) Intersect(Rect) Intersect(Rect)

Finds the intersection of the rectangle represented by the current Rect and the rectangle represented by the specified Rect, and stores the result as the current Rect.

ToString() ToString() ToString() ToString()

Returns a string representation of the Rect struct.

ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider)

Returns a string representation of the rectangle by using the specified format provider.

Union(Point) Union(Point) Union(Point) Union(Point)

Expands the rectangle represented by the current Rect exactly enough to contain the specified point.

Union(Rect) Union(Rect) Union(Rect) Union(Rect)

Expands the rectangle represented by the current Rect exactly enough to contain the specified rectangle.

Operators

Equality(Rect, Rect) Equality(Rect, Rect) Equality(Rect, Rect) Equality(Rect, Rect)

Compares two Rect structs for equality.

Inequality(Rect, Rect) Inequality(Rect, Rect) Inequality(Rect, Rect) Inequality(Rect, Rect)

Compares two Rect structs for inequality.

Explicit Interface Implementations

IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider)

For a description of this member, see ToString(String, IFormatProvider).

Applies to