Rect
Struct · namespace System.Ui · Since 0.32
struct Rect : IEquatable<Rect>A rectangle in pixels: X and Y are its top left corner.
Fields
Section titled “Fields”| Name | Description |
|---|---|
X |
The left edge. |
Y |
The top edge. |
Width |
The width in pixels. |
Height |
The height in pixels. |
int XThe left edge.
int YThe top edge.
int WidthThe width in pixels.
Height
Section titled “Height”int HeightThe height in pixels.
Static methods
Section titled “Static methods”| Name | Description |
|---|---|
Create |
A rectangle with its top left corner at (x, y). |
Create
Section titled “Create”static Rect Create(int x, int y, int width, int height)A rectangle with its top left corner at (x, y).
Methods
Section titled “Methods”| Name | Description |
|---|---|
Right |
The first column to the right of the rectangle. |
Bottom |
The first row below the rectangle. |
Contains |
True if the point lies inside (the right and bottom edges are outside). |
Shrink |
The rectangle made smaller by amount on every side (larger for a negative amount). |
Intersect |
The part that both rectangles cover (empty if they do not overlap). |
IsEmpty |
True if it covers no pixel. |
Equals |
True if both have the same position and size. |
ToString |
“(x, y, width x height)”. |
int Right()The first column to the right of the rectangle.
Bottom
Section titled “Bottom”int Bottom()The first row below the rectangle.
Contains
Section titled “Contains”bool Contains(int x, int y)True if the point lies inside (the right and bottom edges are outside).
Shrink
Section titled “Shrink”Rect Shrink(int amount)The rectangle made smaller by amount on every side (larger for a negative amount).
Intersect
Section titled “Intersect”Rect Intersect(Rect other)The part that both rectangles cover (empty if they do not overlap).
IsEmpty
Section titled “IsEmpty”bool IsEmpty()True if it covers no pixel.
Equals
Section titled “Equals”bool Equals(Rect other)True if both have the same position and size.
ToString
Section titled “ToString”string ToString()“(x, y, width x height)”.