Share via


Rect Struct

Definition

Represents a rectangle with double-precision floating-point x, y coordinates and width and height.

public value class Rect
[System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.Graphics.Converters.RectTypeConverter))]
public struct Rect
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.Graphics.Converters.RectTypeConverter))>]
type Rect = struct
Public Structure Rect
Inheritance
Rect
Attributes

Constructors

Name Description
Rect(Double, Double, Double, Double)

Initializes a new instance of the Rect struct with the specified position and dimensions.

Rect(Point, Size)

Fields

Name Description
Zero

A rectangle with all values (X, Y, Width, Height) set to zero.

Properties

Name Description
Bottom
Center
Height

Gets or sets the height of the rectangle.

IsEmpty
Left
Location
Right
Size
Top
Width

Gets or sets the width of the rectangle.

X

Gets or sets the x-coordinate of the rectangle's left edge.

Y

Gets or sets the y-coordinate of the rectangle's top edge.

Methods

Name Description
Contains(Double, Double)
Contains(Point)
Contains(Rect)
Deconstruct(Double, Double, Double, Double)
Equals(Object)
Equals(Rect)
FromLTRB(Double, Double, Double, Double)
GetHashCode()
Inflate(Double, Double)
Inflate(Size)
Intersect(Rect, Rect)
Intersect(Rect)
IntersectsWith(Rect)
Offset(Double, Double)
Offset(Point)
Round()
ToString()

Returns a string representation of the rectangle.

TryParse(String, Rect)
Union(Rect, Rect)
Union(Rect)

Operators

Name Description
Equality(Rect, Rect)
Implicit(Rect to RectF)
Inequality(Rect, Rect)

Extension Methods

Name Description
Lerp(Rect, Rect, Double)

Applies to