Class RectangleF
A Rectangle with a float X, Y, Width and Height.
public class RectangleF
- Inheritance
-
RectangleF
- Inherited Members
Constructors
RectangleF(float, float, float, float)
Initializes a new instance of the RectangleF class.
public RectangleF(float x, float y, float width, float height)
Parameters
Fields
Empty
An empty rectangle.
public static readonly RectangleF Empty
Field Value
Properties
Bottom
Gets the bottom (Y) of the rectangle.
public float Bottom { get; }
Property Value
- float
The bottom.
Height
Gets the height of the rectangle.
public float Height { get; }
Property Value
- float
The height.
Left
Gets the left (X) of the rectangle.
public float Left { get; }
Property Value
- float
The left.
Location
Gets the location (top left) of the rectangle.
public PointF Location { get; }
Property Value
- PointF
The location.
Right
Gets the right (X) of the rectangle.
public float Right { get; }
Property Value
- float
The right.
Top
Gets the top (Y) of the rectangle.
public float Top { get; }
Property Value
- float
The top.
Width
Gets the width of the rectangle.
public float Width { get; }
Property Value
- float
The width.
X
Gets the X coordinate of the rectangle.
public float X { get; }
Property Value
- float
The x.
Y
Gets the Y coordinate of the rectangle.
public float Y { get; }
Property Value
- float
The y.
Methods
Equals(object?)
Determines whether the specified object, is equal to this instance.
public override bool Equals(object? obj)
Parameters
Returns
FromLtrb(float, float, float, float)
Gets a rectangle from left top right bottom.
public static RectangleF FromLtrb(float left, float top, float right, float bottom)
Parameters
Returns
- RectangleF
The RectangleF.
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Offset(PointF)
Gets a new rectangle that is offset from the current by the point p.
public RectangleF Offset(PointF p)
Parameters
p
PointFThe p.
Returns
- RectangleF
The RectangleF with offset applied.
ToBoundingBox()
Converts to equivalent BoundingBox object.
public BoundingBox ToBoundingBox()