RectangleF
Describes a rectangle using float units.
Definition
Namespace:Telerik.Windows.Documents.Model
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public struct RectangleF
Constructors
Initializes a new instance of the RectangleF struct.
Initializes a new instance of the RectangleF struct.
Fields
Empty rectangle.
public static readonly RectangleF Empty
Properties
Gets the bottom.
[Browsable(false)]
public float Bottom { get; }
The bottom.
Gets the center point of the rectangle represented by this instance.
public PointF Center { get; }
A PointF representing the center point of the rectangle.
Gets or sets the height.
public float Height { readonly get; set; }
The height.
Gets a value indicating whether this instance is empty.
[Browsable(false)]
public bool IsEmpty { get; }
true if this instance is empty; otherwise, false.
Gets or sets the location.
[Browsable(false)]
public PointF Location { get; set; }
The location.
Gets the right.
[Browsable(false)]
public float Right { get; }
The right.
Gets or sets the size.
[Browsable(false)]
public SizeF Size { get; set; }
The size.
Gets or sets the width.
public float Width { readonly get; set; }
The width.
Gets or sets the x position.
public float X { readonly get; set; }
The x position.
Methods
Determines whether this instance contains the object.
public bool Contains(RectangleF rect)
The rect.
Returns:true if this instance contains the specified rect; otherwise, false.
Returns a hash code for this instance.
public override int GetHashCode()
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Overrides:
Creates a new rectangle that is a rounded copy of the current rectangle.
public RectangleF GetRoundedCopy(int decimals)
The radius to be used for rounding the corners of the rectangle.
Returns:A new instance of RectangleF that has rounded corners based on the specified radius.
Inflates the specified rect.
public static RectangleF Inflate(RectangleF rect, float x, float y)
The rect.
xfloatThe x.
yfloatThe y.
Returns:Inflates the specified size.
Determines the intersection of two rectangles and returns the overlapping area as a new rectangle.
public static RectangleF Intersect(RectangleF rectangle1, RectangleF rectangle2)
The first rectangle to intersect.
rectangle2RectangleFThe second rectangle to intersect.
Returns:A new RectangleF that represents the intersecting area. If the rectangles do not intersect, an empty rectangle is returned.
Intersects the specified rect.
Determines whether this instance intersects with another rectangle.
Converts the rectangle's dimensions to a string representation.
public override string ToString()
A string that represents the rectangle's dimensions in the format "Width: {width}, Height: {height}".
Overrides:
Calculates the union of two rectangles represented by RectangleF instances.
public static RectangleF Union(RectangleF rectangle1, RectangleF rectangle2)
The first rectangle to be included in the union.
rectangle2RectangleFThe second rectangle to be included in the union.
Returns:A new RectangleF that represents the smallest rectangle that contains both input rectangles.
Operators
Implements the operator !=.
public static bool operator !=(RectangleF left, RectangleF right)
The left.
rightRectangleFThe right.
Returns:The result of the operator.
Implements the operator ==.
public static bool operator ==(RectangleF left, RectangleF right)
The left.
rightRectangleFThe right.
Returns:The result of the operator.