Struct RECT
Rectangle coordinates left top right bottom.
public record struct RECT : IEquatable<RECT>
Remarks
This type can be used with Windows API functions. The .NET Rectangle etc can't, because their fields are different.
Has conversions from/to System.Drawing.Rectangle.
Namespace: Au.Types
Assembly: Au.dll
Constructors
| Name | Description |
|---|---|
| RECT(int, int, int, int) | Sets all fields. |
Fields
| Name | Description |
|---|---|
| bottom | |
| left | |
| right | |
| top |
Properties
| Name | Description |
|---|---|
| CenterX | Gets horizontal center. |
| CenterY | Gets vertical center. |
| Height | Gets or sets height. |
| Is0 | Returns |
| NoArea | Returns |
| Size | Returns |
| Width | Gets or sets width. |
| XY | Returns |
Methods
| Name | Description |
|---|---|
| Contains(POINT) | Returns |
| Contains(RECT) | Returns |
| Contains(int, int) | Returns |
| EnsureInScreen(screen, bool) | Adjusts this rectangle to ensure that whole rectangle is in screen. Initial and final rectangle coordinates are relative to the primary screen. |
| From(RectangleF, bool) | |
| From(Rect, bool) | |
| FromLTRB(int, int, int, int) | Creates RECT with specified |
| Inflate(int, int) | Makes this rectangle bigger or smaller: |
| Intersect(RECT) | Replaces this rectangle with the intersection of itself and the specified rectangle. If the rectangles don't intersect, makes this variable empty. |
| Intersect(RECT, RECT) | Returns the intersection rectangle of two rectangles. If they don't intersect, returns empty rectangle. |
| IntersectsWith(RECT) | Returns |
| Move(int, int) | Moves this rectangle so that |
| MoveInRect(RECT, Coord, Coord, bool) | Moves this rectangle to the specified coordinates in another rectangle r. |
| MoveInScreen(Coord, Coord, screen, bool, bool) | Moves this rectangle to the specified coordinates in the specified screen, and ensures that whole rectangle is in screen. Final rectangle coordinates are relative to the primary screen. |
| Normalize(bool) | If |
| Offset(int, int) | Moves this rectangle by the specified offsets: |
| ToString() | Converts to string |
| ToStringFormat(string) | Formats string from RECT main fields and properties. |
| ToStringSimple() | Converts to string |
| TryParse(string, out RECT) | Converts string to RECT. |
| Union(RECT) | Replaces this rectangle with the union of itself and the specified rectangle. Union is the smallest rectangle that contains two full rectangles. |
| Union(RECT, RECT) | Returns the union of two rectangles. Union is the smallest rectangle that contains two full rectangles. |
Operators
| Name | Description |
|---|---|
| implicit operator Rectangle(RECT) | |
| implicit operator RectangleF(RECT) | |
| implicit operator Rect(RECT) | |
| implicit operator RECT(Rectangle) | |
| implicit operator RECT((int L, int T, int W, int H)) | Converts from tuple (left, top, width, height). |