Struct
RectangleF

Describes a rectangle using float units.

Definition

Namespace:Telerik.Windows.Documents.Model

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public struct RectangleF

Constructors

RectangleF(PointF, SizeF)

Initializes a new instance of the RectangleF struct.

Declaration

cs-api-definition
public RectangleF(PointF location, SizeF size)

Parameters

location

PointF

The location.

size

SizeF

The size.

RectangleF(float, float, float, float)

Initializes a new instance of the RectangleF struct.

Declaration

cs-api-definition
public RectangleF(float x, float y, float width, float height)

Parameters

x

float

The x position.

y

float

The y position.

width

float

The width.

height

float

The height.

Fields

Empty

Empty rectangle.

Declaration

cs-api-definition
public static readonly RectangleF Empty

Field Value

RectangleF

Properties

Bottom

Gets the bottom.

Declaration

cs-api-definition
[Browsable(false)]
public float Bottom { get; }

Property Value

float

The bottom.

Center

Gets the center point of the rectangle represented by this instance.

Declaration

cs-api-definition
public PointF Center { get; }

Property Value

PointF

A PointF representing the center point of the rectangle.

Height

Gets or sets the height.

Declaration

cs-api-definition
public float Height { readonly get; set; }

Property Value

float

The height.

IsEmpty

Gets a value indicating whether this instance is empty.

Declaration

cs-api-definition
[Browsable(false)]
public bool IsEmpty { get; }

Property Value

bool

true if this instance is empty; otherwise, false.

Left

Gets the left.

Declaration

cs-api-definition
[Browsable(false)]
public float Left { get; }

Property Value

float

The left.

Location

Gets or sets the location.

Declaration

cs-api-definition
[Browsable(false)]
public PointF Location { get; set; }

Property Value

PointF

The location.

Right

Gets the right.

Declaration

cs-api-definition
[Browsable(false)]
public float Right { get; }

Property Value

float

The right.

Size

Gets or sets the size.

Declaration

cs-api-definition
[Browsable(false)]
public SizeF Size { get; set; }

Property Value

SizeF

The size.

Top

Gets the top.

Declaration

cs-api-definition
[Browsable(false)]
public float Top { get; }

Property Value

float

The top.

Width

Gets or sets the width.

Declaration

cs-api-definition
public float Width { readonly get; set; }

Property Value

float

The width.

X

Gets or sets the x position.

Declaration

cs-api-definition
public float X { readonly get; set; }

Property Value

float

The x position.

Y

Gets or sets the y position.

Declaration

cs-api-definition
public float Y { readonly get; set; }

Property Value

float

The y position.

Methods

Contains(PointF)

Determines whether this instance contains a point.

Declaration

cs-api-definition
public bool Contains(PointF point)

Parameters

point

PointF

The point.

Returns

bool

true if contains the specified point; otherwise, false.

Contains(RectangleF)

Determines whether this instance contains the object.

Declaration

cs-api-definition
public bool Contains(RectangleF rect)

Parameters

rect

RectangleF

The rect.

Returns

bool

true if this instance contains the specified rect; otherwise, false.

Contains(float, float)

Determines whether this instance contains a point.

Declaration

cs-api-definition
public bool Contains(float x, float y)

Parameters

x

float

The x-coordinate of the point.

y

float

The y-coordinate of the point.

Returns

bool

true if contains the specified coordinates; otherwise, false.

Equals(object)

Determines whether the specified object, is equal to this instance.

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

The object to compare with this instance.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

Overrides ValueType.Equals(object)

FromLtrb(double, double, double, double)

Froms the LTRB.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ltrb")]
public static RectangleF FromLtrb(double left, double top, double right, double bottom)

Parameters

left

double

The left.

top

double

The top.

right

double

The right.

bottom

double

The bottom.

Returns

RectangleF

GetHashCode()

Returns a hash code for this instance.

Declaration

cs-api-definition
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.

Overrides ValueType.GetHashCode()

GetRoundedCopy(int)

Creates a new rectangle that is a rounded copy of the current rectangle.

Declaration

cs-api-definition
public RectangleF GetRoundedCopy(int decimals)

Parameters

decimals

int

The radius to be used for rounding the corners of the rectangle.

Returns

RectangleF

A new instance of RectangleF that has rounded corners based on the specified radius.

Inflate(RectangleF, float, float)

Inflates the specified rect.

Declaration

cs-api-definition
public static RectangleF Inflate(RectangleF rect, float x, float y)

Parameters

rect

RectangleF

The rect.

x

float

The x.

y

float

The y.

Returns

RectangleF

Inflate(SizeF)

Inflates the specified size.

Declaration

cs-api-definition
public void Inflate(SizeF size)

Parameters

size

SizeF

The size.

Inflate(float, float)

Inflates the specified x and y coordinates.

Declaration

cs-api-definition
public void Inflate(float x, float y)

Parameters

x

float

The x.

y

float

The y.

Intersect(RectangleF)

Intersects the specified rect.

Declaration

cs-api-definition
public void Intersect(RectangleF rect)

Parameters

rect

RectangleF

The rect.

Intersect(RectangleF, RectangleF)

Determines the intersection of two rectangles and returns the overlapping area as a new rectangle.

Declaration

cs-api-definition
public static RectangleF Intersect(RectangleF rectangle1, RectangleF rectangle2)

Parameters

rectangle1

RectangleF

The first rectangle to intersect.

rectangle2

RectangleF

The second rectangle to intersect.

Returns

RectangleF

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

cs-api-definition
public bool IntersectsWith(RectangleF rect)

Parameters

rect

RectangleF

The rect.

Returns

bool

Offset(PointF)

Translates the rectangle by the specified point.

Declaration

cs-api-definition
public void Offset(PointF point)

Parameters

point

PointF

A PointF that specifies the translation offset.

Offset(float, float)

Offsets the rectangle by the specified amounts in the X and Y directions.

Declaration

cs-api-definition
public void Offset(float x, float y)

Parameters

x

float

The amount to offset the rectangle in the X direction.

y

float

The amount to offset the rectangle in the Y direction.

ToString()

Converts the rectangle's dimensions to a string representation.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string that represents the rectangle's dimensions in the format "Width: {width}, Height: {height}".

Overrides ValueType.ToString()

Union(RectangleF, RectangleF)

Calculates the union of two rectangles represented by RectangleF instances.

Declaration

cs-api-definition
public static RectangleF Union(RectangleF rectangle1, RectangleF rectangle2)

Parameters

rectangle1

RectangleF

The first rectangle to be included in the union.

rectangle2

RectangleF

The second rectangle to be included in the union.

Returns

RectangleF

A new RectangleF that represents the smallest rectangle that contains both input rectangles.

Operators

implicit operator RectangleF(Rect)

Declaration

cs-api-definition
public static implicit operator RectangleF(Rect rect)

Parameters

rect

Rect

Returns

RectangleF

operator !=(RectangleF, RectangleF)

Implements the operator !=.

Declaration

cs-api-definition
public static bool operator !=(RectangleF left, RectangleF right)

Parameters

left

RectangleF

The left.

right

RectangleF

The right.

Returns

bool

The result of the operator.

operator ==(RectangleF, RectangleF)

Implements the operator ==.

Declaration

cs-api-definition
public static bool operator ==(RectangleF left, RectangleF right)

Parameters

left

RectangleF

The left.

right

RectangleF

The right.

Returns

bool

The result of the operator.

Extension Methods