Class Rect
Stores a set of four integers that represent the location and size of a rectangle
Inheritance
System.Object
Rect
Assembly: Terminal.Gui.dll
Syntax
public sealed class Rect : ValueType
Constructors
Rect(Int32, Int32, Int32, Int32)
Rectangle Constructor
Declaration
public Rect(int x, int y, int width, int height)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
System.Int32 |
width |
|
System.Int32 |
height |
|
Rect(Point, Size)
Rectangle Constructor
Declaration
public Rect(Point location, Size size)
Parameters
Type |
Name |
Description |
Point |
location |
|
Size |
size |
|
Fields
Empty
Empty Shared Field
Declaration
public static readonly Rect Empty
Field Value
X
Gets or sets the x-coordinate of the upper-left corner of this Rectangle structure.
Declaration
Field Value
Type |
Description |
System.Int32 |
|
Y
Gets or sets the y-coordinate of the upper-left corner of this Rectangle structure.
Declaration
Field Value
Type |
Description |
System.Int32 |
|
Properties
Bottom
Bottom Property
Declaration
public int Bottom { get; }
Property Value
Type |
Description |
System.Int32 |
|
Height
Gets or sets the height of this Rectangle structure.
Declaration
public int Height { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
IsEmpty
IsEmpty Property
Declaration
public bool IsEmpty { get; }
Property Value
Type |
Description |
System.Boolean |
|
Left
Left Property
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Location
Location Property
Declaration
public Point Location { get; set; }
Property Value
Right
Right Property
Declaration
public int Right { get; }
Property Value
Type |
Description |
System.Int32 |
|
Size
Size Property
Declaration
public Size Size { get; set; }
Property Value
Top
Top Property
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Width
Gets or sets the width of this Rect structure.
Declaration
public int Width { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
Contains(Int32, Int32)
Contains Method
Declaration
public bool Contains(int x, int y)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
Returns
Type |
Description |
System.Boolean |
|
Contains(Point)
Contains Method
Declaration
public bool Contains(Point pt)
Parameters
Type |
Name |
Description |
Point |
pt |
|
Returns
Type |
Description |
System.Boolean |
|
Contains(Rect)
Contains Method
Declaration
public bool Contains(Rect rect)
Parameters
Type |
Name |
Description |
Rect |
rect |
|
Returns
Type |
Description |
System.Boolean |
|
Equals(Object)
Equals Method
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
FromLTRB(Int32, Int32, Int32, Int32)
FromLTRB Shared Method
Declaration
public static Rect FromLTRB(int left, int top, int right, int bottom)
Parameters
Type |
Name |
Description |
System.Int32 |
left |
|
System.Int32 |
top |
|
System.Int32 |
right |
|
System.Int32 |
bottom |
|
Returns
GetHashCode()
GetHashCode Method
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Inflate(Int32, Int32)
Inflate Method
Declaration
public void Inflate(int width, int height)
Parameters
Type |
Name |
Description |
System.Int32 |
width |
|
System.Int32 |
height |
|
Inflate(Rect, Int32, Int32)
Inflate Shared Method
Declaration
public static Rect Inflate(Rect rect, int x, int y)
Parameters
Type |
Name |
Description |
Rect |
rect |
|
System.Int32 |
x |
|
System.Int32 |
y |
|
Returns
Inflate(Size)
Inflate Method
Declaration
public void Inflate(Size size)
Parameters
Type |
Name |
Description |
Size |
size |
|
Intersect(Rect)
Intersect Method
Declaration
public void Intersect(Rect rect)
Parameters
Type |
Name |
Description |
Rect |
rect |
|
Intersect(Rect, Rect)
Intersect Shared Method
Declaration
public static Rect Intersect(Rect a, Rect b)
Parameters
Returns
IntersectsWith(Rect)
IntersectsWith Method
Declaration
public bool IntersectsWith(Rect rect)
Parameters
Type |
Name |
Description |
Rect |
rect |
|
Returns
Type |
Description |
System.Boolean |
|
Offset(Int32, Int32)
Offset Method
Declaration
public void Offset(int x, int y)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
Offset(Point)
Offset Method
Declaration
public void Offset(Point pos)
Parameters
Type |
Name |
Description |
Point |
pos |
|
ToString()
ToString Method
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Union(Rect, Rect)
Union Shared Method
Declaration
public static Rect Union(Rect a, Rect b)
Parameters
Returns
Operators
Equality(Rect, Rect)
Equality Operator
Declaration
public static bool operator ==(Rect left, Rect right)
Parameters
Type |
Name |
Description |
Rect |
left |
|
Rect |
right |
|
Returns
Type |
Description |
System.Boolean |
|
Inequality(Rect, Rect)
Inequality Operator
Declaration
public static bool operator !=(Rect left, Rect right)
Parameters
Type |
Name |
Description |
Rect |
left |
|
Rect |
right |
|
Returns
Type |
Description |
System.Boolean |
|