# Rectangle Struct

## Definition

Struct defining a rectangle, using doubles.

``````[System.Diagnostics.DebuggerDisplay("X={X}, Y={Y}, Width={Width}, Height={Height}")]
[Xamarin.Forms.TypeConverter(typeof(Xamarin.Forms.RectangleTypeConverter))]
public struct Rectangle``````
``type Rectangle = struct``
Inheritance
Rectangle
Attributes

## Remarks

Application developers should be aware of the limits of floating-point representations, specifically the possibility of incorrect comparisons and equality checks for values with small differences. David Goldberg's paper What Every Computer Scientist Should Know About Floating-Point Arithmetic describes the issues excellently.

Where Xamarin.Forms supports XAML for Rectangle structures, app devs can represent the rectangle as a comma-separated list of the X-coordinate, Y-Coordinate, Width, and Height.

## Constructors

 Creates a new Rectangle object with its top left corner at (`x`, `y`) and `width` wide and `height` tall. Creates a new Rectangle object with its top left corner at `loc` with a height and width that are specified by `sz`.

## Fields

 The Rectangle at {0,0} whose Size is {0,0}.

## Properties

 The bottom of the Rectangle. The Point halfway between Left and Right, Top and Bottom. Extent along the Y axis. Whether `this`Rectangle has either Height or Width less than or equal to 0. The position of the Rectangle on the X axis. The Point defined by Left and Top. The furthest extent along the X axis. The extent of the Rectangle along its X and Y axes. The top of the Rectangle. The extent of this Rectangle along the X axis. The position of this Rectangle on the X axis. The position of this Rectangle on the Y axis.

## Methods

 Whether the point described by `x` and `y` is within, or along the periphery of, this Rectangle. Whether the `pt` is within, or along the periphery, of this Rectangle. Whether `rect` is entirely within, or along the periphery, of this Rectangle. Stores the components of the location and size of the rectangle in the corresponding arguments. Whether an Object is a Rectangle and has exactly the same values as `this`Rectangle. Whether a Rectangle has exactly the same values as `this`Rectangle. Factory method to create a Rectangle from `left`, `top`, `right`, and `bottom`. The hashcode for the Rectangle. Creates a Rectangle whose borders are inflated in every direction. Creates a Rectangle whose borders are inflated in every direction. A new Rectangle that is the intersection of `this` and `r`. A new Rectangle that is the intersection of `r1` and `r2`. Whether `this`Rectangle intersects `r`. A new Rectangle whose Location is offset by `dx` and `dy`. A new Rectangle whose Location is offset by `dr`. Returns a new Rectangle whose values have been rounded to their nearest integral value. A human-readable description of the Rectangle. A new Rectangle whose bounds cover the union of `this`Rectangle and `r`. A new Rectangle whose bounds cover the union of `r1` and `r2`.

## Operators

 Whether two Rectangles have equal values. Whether two Rectangles have unequal values.