# RectangleF struct

Namespace: [Eto.Drawing](https://eto.picoe.ca/api/namespace/eto.drawing.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
[TypeConverter(RectangleFConverterInternal)]
public struct RectangleF : IEquatable<RectangleF>
```

Represents a floating point rectangle with a location (X, Y) and size (Width, Height) components.

**Remarks:** A rectangle is defined by a location (X, Y) and a size (Width, Height). The width and/or height can be negative.

## Constructors

- [RectangleF](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/ctor.md): (5 overloads) Initializes a new instance of the Rectangle class with the specified `x`, `y`, `width`, and `height`

## Fields

- [Empty](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/empty.md): (static) Gets an empty rectangle with zero X, Y, Width, and Height components

## Properties

- [Bottom](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/bottom.md): Gets or sets the logical bottom of this rectangle (Y + Height if Height is positive, Y + 1 if negative)
- [BottomLeft](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/bottomleft.md): Gets or sets the point at the [RectangleF.Bottom](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/bottom.md) and [RectangleF.Left](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/left.md) of the rectangle
- [BottomRight](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/bottomright.md): Gets or sets the point at the [RectangleF.Bottom](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/bottom.md) and [RectangleF.Right](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/right.md) of the rectangle
- [Center](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/center.md): Gets or sets the rectangle's center position
- [EndLocation](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/endlocation.md): Gets the ending location of this rectangle
- [Height](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/height.md): Gets or sets the Height of this rectangle
- [InnerBottom](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/innerbottom.md): Gets or sets the bottom of the rectangle that is inside the bounds
- [InnerBottomLeft](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/innerbottomleft.md): Gets or sets the point at the [RectangleF.InnerBottom](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/innerbottom.md) and [RectangleF.Left](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/left.md) of the rectangle
- [InnerBottomRight](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/innerbottomright.md): Gets or sets the point at the [RectangleF.InnerBottom](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/innerbottom.md) and [RectangleF.InnerRight](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/innerright.md) of the rectangle
- [InnerRight](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/innerright.md): Gets or sets the right of the rectangle that is inside the bounds
- [InnerTopRight](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/innertopright.md): Gets or sets the point at the [RectangleF.Top](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/top.md) and [RectangleF.InnerRight](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/innerright.md) of the rectangle
- [IsEmpty](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/isempty.md): Gets a value indicating that the [RectangleF.Size](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/size.md) of this rectangle is empty (either the width or height are zero)
- [IsZero](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/iszero.md): Gets a value indicating that both the `` and [RectangleF.Size](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/size.md) of this rectangle are zero
- [Left](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/left.md): Gets or sets the logical left of this rectangle (X co-ordinate if Width is positive, X + Width if negative)
- [Location](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/location.md): Gets the location of this rectangle
- [MiddleBottom](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middlebottom.md): Gets or sets the point at the [RectangleF.MiddleX](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middlex.md) and [RectangleF.Bottom](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/bottom.md) of the rectangle
- [MiddleLeft](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middleleft.md): Gets or sets the point at the [RectangleF.Left](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/left.md) and [RectangleF.MiddleY](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middley.md) of the rectangle
- [MiddleRight](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middleright.md): Gets or sets the point at the [RectangleF.Right](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/right.md) and [RectangleF.MiddleY](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middley.md) of the rectangle
- [MiddleTop](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middletop.md): Gets or sets the point at the [RectangleF.MiddleX](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middlex.md) and [RectangleF.Top](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/top.md) of the rectangle
- [MiddleX](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middlex.md): Gets or sets the rectangle's middle horizontal position
- [MiddleY](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/middley.md): Gets or sets the rectangle's middle vertical position
- [Right](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/right.md): Gets or sets the logical right of this rectangle (X + Width if Width is positive, X + 1 if negative)
- [Size](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/size.md): Gets or sets the size of the rectangle
- [Top](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/top.md): Gets or sets the logical top of this rectangle (Y co-ordinate if Height is positive, Y + Height if negative)
- [TopLeft](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/topleft.md): Gets or sets the point at the [RectangleF.Top](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/top.md) and [RectangleF.Left](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/left.md) of the rectangle
- [TopRight](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/topright.md): Gets or sets the point at the [RectangleF.Top](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/top.md) and [RectangleF.Right](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/right.md) of the rectangle
- [Width](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/width.md): Gets or sets the Width of this rectangle
- [X](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/x.md): Gets or sets the X co-ordinate of the [RectangleF.Location](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/location.md) of this rectangle
- [Y](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/y.md): Gets or sets the Y co-ordinate of the [RectangleF.Location](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/location.md) of this rectangle

## Methods

- [Align](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/align.md): (4 overloads) Aligns the `rectangle` to a grid of the specified `gridWidth` and `gridHeight`
- [Contains](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/contains.md): (3 overloads) Gets a value indicating that the specified `x` and `y` co-ordinates are within the bounds of this rectangle
- [Distance](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/distance.md): (2 overloads, static) Calculates the distance between the specified `point` and `rect`.
- [Equals](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/equals.md): (2 overloads) Compares this rectangle to an object for equality
- [FromCenter](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/fromcenter.md): (static) Creates a new instance of a RectangleF with a specified `center` and `size`
- [FromSides](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/fromsides.md): (static) Creates a new instance of a RectangleF from the values of the `left`, `top`, `right` and `bottom` sides
- [GetHashCode](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/gethashcode.md): Gets the hash code for this rectangle
- [Inflate](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/inflate.md): (4 overloads) Inflates all dimensions of this `rectangle` by the specified `width` and `height`
- [Inset](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/inset.md): (2 overloads) Returns a new rectangle that is inset by the specified `padding`
- [Intersect](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/intersect.md): (2 overloads) Intersect the two specified rectangles
- [Intersects](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/intersects.md): Gets a value indicating that the specified `rectangle` overlaps this rectangle
- [Normalize](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/normalize.md): Normalizes the rectangle so both the [RectangleF.Width](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/width.md) and [RectangleF.Height](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/height.md) are positive, without changing the location of the rectangle
- [Offset](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/offset.md): (6 overloads) Offsets the location of the `rectangle` by the specified `x` and `y` values
- [Restrict](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/restrict.md): (4 overloads) Restricts the `rectangle` to be within the `restrict` rectangle
- [ToString](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/tostring.md): Converts this rectangle to a string
- [Union](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/union.md): (2 overloads) Combines two rectangles into one rectangle that encompasses both

## Operators

- [operator +](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/op-addition.md): (3 overloads, static) Returns a rectangle inset by the specified padding
- [operator /](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/op-division.md): (2 overloads, static) Divides all X, Y, Width, Height components of the `rectangle` by a `factor` factor
- [operator ==](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/op-equality.md): (static) Compares two rectangles for equality
- [operator !=](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/op-inequality.md): (static) Compares two rectangles for inequality
- [operator *](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/op-multiply.md): (2 overloads, static) Multiplies all X, Y, Width, Height components of the `rectangle` by a `factor`
- [operator -](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/op-subtraction.md): (3 overloads, static) Returns a rectangle expanded by the specified padding

## Convertors

- [operator implicit](https://eto.picoe.ca/api/type/eto.drawing.rectanglef/op-implicit.md): (static) Implicit conversion from a [Rectangle](https://eto.picoe.ca/api/type/eto.drawing.rectangle.md) to a [RectangleF](https://eto.picoe.ca/api/type/eto.drawing.rectanglef.md)
