Table of Contents

Class Rect

Namespace
VAST.Common
Assembly
VAST.Common.dll

Represents a rectangle defined by its left, top, right, and bottom coordinates.

public class Rect
Inheritance
Rect
Inherited Members

Constructors

Rect()

Initializes a new instance of the Rect class with default values.

public Rect()

Rect(double, double, double, double)

Initializes a new instance of the Rect class with double coordinates.

public Rect(double left, double top, double right, double bottom)

Parameters

left double

The left coordinate.

top double

The top coordinate.

right double

The right coordinate.

bottom double

The bottom coordinate.

Rect(int, int, int, int)

Initializes a new instance of the Rect class with integer coordinates.

public Rect(int left, int top, int right, int bottom)

Parameters

left int

The left coordinate.

top int

The top coordinate.

right int

The right coordinate.

bottom int

The bottom coordinate.

Properties

Bottom

Gets or sets the bottom coordinate of the rectangle.

public double Bottom { get; set; }

Property Value

double

Height

Gets the height of the rectangle.

public double Height { get; }

Property Value

double

Left

Gets or sets the left coordinate of the rectangle.

public double Left { get; set; }

Property Value

double

Right

Gets or sets the right coordinate of the rectangle.

public double Right { get; set; }

Property Value

double

Top

Gets or sets the top coordinate of the rectangle.

public double Top { get; set; }

Property Value

double

Width

Gets the width of the rectangle.

public double Width { get; }

Property Value

double

Methods

Equals(object)

Determines whether this rectangle is equal to another object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with.

Returns

bool

True if the objects are equal; otherwise, false.

GetHashCode()

Returns a hash code for this rectangle.

public override int GetHashCode()

Returns

int

A hash code based on the rectangle coordinates.

IsEmpty()

Determines whether the rectangle is empty (all coordinates are zero).

public bool IsEmpty()

Returns

bool

True if all coordinates are zero; otherwise, false.

ToString()

Returns a string representation of this rectangle.

public override string ToString()

Returns

string

A string in the format "[left,top,right,bottom]".

Operators

operator ==(Rect, Rect)

Determines whether two Rect instances are equal.

public static bool operator ==(Rect left, Rect right)

Parameters

left Rect

The first rectangle.

right Rect

The second rectangle.

Returns

bool

True if both rectangles are equal; otherwise, false.

operator !=(Rect, Rect)

Determines whether two Rect instances are not equal.

public static bool operator !=(Rect left, Rect right)

Parameters

left Rect

The first rectangle.

right Rect

The second rectangle.

Returns

bool

True if the rectangles are not equal; otherwise, false.