StructRectangleF
Describes a rectangle using float units.
Definition
Namespace:Telerik.Windows.Documents.Model
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public struct RectangleF
Constructors
RectangleF(PointF, SizeF)
Initializes a new instance of the RectangleF struct.
RectangleF(float, float, float, float)
Initializes a new instance of the RectangleF struct.
Fields
Empty
Empty rectangle.
Properties
Bottom
Gets the bottom.
Declaration
[Browsable(false)]
public float Bottom { get; }
Property Value
The bottom.
Center
Gets the center point of the rectangle represented by this instance.
Height
Gets or sets the height.
Declaration
public float Height { readonly get; set; }
Property Value
The height.
IsEmpty
Gets a value indicating whether this instance is empty.
Declaration
[Browsable(false)]
public bool IsEmpty { get; }
Property Value
true if this instance is empty; otherwise, false.
Left
Gets the left.
Declaration
[Browsable(false)]
public float Left { get; }
Property Value
The left.
Location
Gets or sets the location.
Declaration
[Browsable(false)]
public PointF Location { get; set; }
Property Value
The location.
Right
Gets the right.
Declaration
[Browsable(false)]
public float Right { get; }
Property Value
The right.
Size
Gets or sets the size.
Declaration
[Browsable(false)]
public SizeF Size { get; set; }
Property Value
The size.
Top
Gets the top.
Declaration
[Browsable(false)]
public float Top { get; }
Property Value
The top.
Width
Gets or sets the width.
Declaration
public float Width { readonly get; set; }
Property Value
The width.
X
Gets or sets the x position.
Declaration
public float X { readonly get; set; }
Property Value
The x position.
Methods
Contains(PointF)
Determines whether this instance contains a point.
Contains(RectangleF)
Determines whether this instance contains the object.
Declaration
public bool Contains(RectangleF rect)
Parameters
rect
The rect.
Returns
true if this instance contains the specified rect; otherwise, false.
Contains(float, float)
Determines whether this instance contains a point.
Equals(object)
Determines whether the specified object, is equal to this instance.
FromLtrb(double, double, double, double)
Froms the LTRB.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ltrb")]
public static RectangleF FromLtrb(double left, double top, double right, double bottom)
Parameters
left
The left.
top
The top.
right
The right.
bottom
The bottom.
Returns
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Overrides
GetRoundedCopy(int)
Creates a new rectangle that is a rounded copy of the current rectangle.
Declaration
public RectangleF GetRoundedCopy(int decimals)
Parameters
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.
Inflate(RectangleF, float, float)
Inflates the specified rect.
Declaration
public static RectangleF Inflate(RectangleF rect, float x, float y)
Parameters
rect
The rect.
x
The x.
y
The y.
Returns
Inflate(SizeF)
Inflates the specified size.
Inflate(float, float)
Inflates the specified x and y coordinates.
Intersect(RectangleF)
Intersects the specified rect.
Declaration
public void Intersect(RectangleF rect)
Parameters
rect
The rect.
Intersect(RectangleF, RectangleF)
Determines the intersection of two rectangles and returns the overlapping area as a new rectangle.
Declaration
public static RectangleF Intersect(RectangleF rectangle1, RectangleF rectangle2)
Parameters
rectangle1
The first rectangle to intersect.
rectangle2
The second rectangle to intersect.
Returns
A new RectangleF that represents the intersecting area. If the rectangles do not intersect, an empty rectangle is returned.
IntersectsWith(RectangleF)
Determines whether this instance intersects with another rectangle.
Declaration
public bool IntersectsWith(RectangleF rect)
Parameters
rect
The rect.
Returns
Offset(PointF)
Translates the rectangle by the specified point.
Offset(float, float)
Offsets the rectangle by the specified amounts in the X and Y directions.
ToString()
Converts the rectangle's dimensions to a string representation.
Declaration
public override string ToString()
Returns
A string that represents the rectangle's dimensions in the format "Width: {width}, Height: {height}".
Overrides
Union(RectangleF, RectangleF)
Calculates the union of two rectangles represented by RectangleF instances.
Declaration
public static RectangleF Union(RectangleF rectangle1, RectangleF rectangle2)
Parameters
rectangle1
The first rectangle to be included in the union.
rectangle2
The second rectangle to be included in the union.
Returns
A new RectangleF that represents the smallest rectangle that contains both input rectangles.
Operators
implicit operator RectangleF(Rect)
Declaration
public static implicit operator RectangleF(Rect rect)
Parameters
rect
Rect
Returns
operator !=(RectangleF, RectangleF)
Implements the operator !=.
Declaration
public static bool operator !=(RectangleF left, RectangleF right)
Parameters
left
The left.
right
The right.
Returns
The result of the operator.
operator ==(RectangleF, RectangleF)
Implements the operator ==.
Declaration
public static bool operator ==(RectangleF left, RectangleF right)
Parameters
left
The left.
right
The right.
Returns
The result of the operator.