Rect Structure
Defines a rectangle.
Definition
Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public readonly struct Rect : IEquatable<Rect>
Public Structure Rect
Implements IEquatable(Of Rect)
[<SealedAttribute>]
type Rect =
struct
inherit ValueType
interface IEquatable<Rect>
end
| Inheritance | Object → ValueType → Rect |
| Implements | IEquatable(Rect) |
Constructors
| Rect(Size) | Initializes a new instance of the Rect structure. |
| Rect(Point, Point) | Initializes a new instance of the Rect structure. |
| Rect(Point, Size) | Initializes a new instance of the Rect structure. |
| Rect(Double, Double, Double, Double) | Initializes a new instance of the Rect structure. |
Properties
| Bottom | Gets the bottom position of the rectangle. |
| BottomLeft | Gets the bottom left point of the rectangle. |
| BottomRight | Gets the bottom right point of the rectangle. |
| Center | Gets the center point of the rectangle. |
| Height | Gets the height. |
| Left | Gets the left position. |
| Position | Gets the position of the rectangle. |
| Right | Gets the right position of the rectangle. |
| Size | Gets the size of the rectangle. |
| Top | Gets the top position. |
| TopLeft | Gets the top left point of the rectangle. |
| TopRight | Gets the top right point of the rectangle. |
| Width | Gets the width. |
| X | Gets the X position. |
| Y | Gets the Y position. |
Methods
| CenterRect(Rect) | Centers another rectangle in this rectangle. |
| Contains(Point) | Determines whether a point is in the bounds of the rectangle. |
| Contains(Rect) | Determines whether the rectangle fully contains another rectangle. |
| ContainsExclusive(Point) | Determines whether a point is in the bounds of the rectangle, exclusive of the rectangle's bottom/right edge. |
| Deflate(Double) | Deflates the rectangle. |
| Deflate(Thickness) | Deflates the rectangle by a Thickness. |
| Equals(Object) | Returns a boolean indicating whether the given object is equal to this rectangle. (Overrides ValueType.Equals(Object)) |
| Equals(Rect) | Returns a boolean indicating whether the rect is equal to the other given rect. |
| GetHashCode() | Returns the hash code for this instance. (Overrides ValueType.GetHashCode()) |
| GetType() | Gets the Type of the current instance. (Inherited from Object) |
| Inflate(Double) | Inflates the rectangle. |
| Inflate(Thickness) | Inflates the rectangle. |
| Intersect(Rect) | Gets the intersection of two rectangles. |
| Intersects(Rect) | Determines whether a rectangle intersects with this rectangle. |
| Normalize() | Normalizes the rectangle so both the Width and Height are positive, without changing the location of the rectangle |
| Parse(String) | Parses a Rect string. |
| ToString() | Returns the string representation of the rectangle. (Overrides ValueType.ToString()) |
| TransformToAABB(Matrix) | Returns the axis-aligned bounding box of a transformed rectangle. |
| Translate(Vector) | Translates the rectangle by an offset. |
| Union(Rect) | Gets the union of two rectangles. |
| WithHeight(Double) | Returns a new Rect with the specified height. |
| WithWidth(Double) | Returns a new Rect with the specified width. |
| WithX(Double) | Returns a new Rect with the specified X position. |
| WithY(Double) | Returns a new Rect with the specified Y position. |
Operators
| Division(Rect, Vector) | Divides a rectangle by a vector. |
| Equality(Rect, Rect) | Checks for equality between two Rects. |
| Inequality(Rect, Rect) | Checks for inequality between two Rects. |
| Multiply(Rect, Vector) | Multiplies a rectangle by a scaling vector. |
| Multiply(Rect, Double) | Multiplies a rectangle by a scale. |
Extension Methods
| Align(Rect, HorizontalAlignment, VerticalAlignment) | Aligns a rect in a constraining rect according to horizontal and vertical alignment settings. (Defined by LayoutExtensions) |
| ToSKRect() | (Defined by SkiaSharpExtensions) |