New to Telerik UI for WinFormsStart a free 30-day trial

Describes a rectanlge using float units.

Definition

Namespace:Telerik.WinForms.Documents.Model

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public struct RectangleF

Constructors

Initializes a new instance of the RectangleF struct.

C#
public RectangleF(float x, float y, float width, float height)
Parameters:xfloat

The x position.

yfloat

The y position.

widthfloat

The width.

heightfloat

The height.

Initializes a new instance of the RectangleF struct.

C#
public RectangleF(PointF location, SizeF size)
Parameters:locationPointF

The location.

sizeSizeF

The size.

Fields

Empty rectangle.

C#
public static readonly RectangleF Empty

Properties

Gets the bottom.

C#
[Browsable(false)]
public float Bottom { get; }
Property Value:

The bottom.

C#
public PointF Center { get; }

Gets or sets the height.

C#
public float Height { readonly get; set; }
Property Value:

The height.

Gets a value indicating whether this instance is empty.

C#
[Browsable(false)]
public bool IsEmpty { get; }
Property Value:

true if this instance is empty; otherwise, false.

Gets the left.

C#
[Browsable(false)]
public float Left { get; }
Property Value:

The left.

Gets or sets the location.

C#
[Browsable(false)]
public PointF Location { get; set; }
Property Value:

The location.

Gets the right.

C#
[Browsable(false)]
public float Right { get; }
Property Value:

The right.

Gets or sets the size.

C#
[Browsable(false)]
public SizeF Size { get; set; }
Property Value:

The size.

Gets the top.

C#
[Browsable(false)]
public float Top { get; }
Property Value:

The top.

Gets or sets the width.

C#
public float Width { readonly get; set; }
Property Value:

The width.

Gets or sets the x position.

C#
public float X { readonly get; set; }
Property Value:

The x position.

Gets or sets the y position.

C#
public float Y { readonly get; set; }
Property Value:

The y position.

Methods

Determines whether this instance contains a point.

C#
public bool Contains(float x, float y)
Parameters:xfloat

The x-coordinate of the point.

yfloat

The y-coordinate of the point.

Returns:

bool

true if contains the specified coordinates; otherwise, false.

Determines whether this instance contains a point.

C#
public bool Contains(PointF point)
Parameters:pointPointF

The point.

Returns:

bool

true if contains the specified point; otherwise, false.

Determines whether this instance contains the object.

C#
public bool Contains(RectangleF rect)
Parameters:rectRectangleF

The rect.

Returns:

bool

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

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

C#
public override bool Equals(object obj)
Parameters:objobject

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)

Froms the LTRB.

C#
public static RectangleF FromLtrb(double left, double top, double right, double bottom)
Parameters:leftdouble

The left.

topdouble

The top.

rightdouble

The right.

bottomdouble

The bottom.

Returns:

RectangleF

Returns a hash code for this instance.

C#
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()

C#
public RectangleF GetRoundedCopy(int decimals)
Parameters:decimalsintReturns:

RectangleF

Inflates the specified x and y coordinates.

C#
public void Inflate(float x, float y)
Parameters:xfloat

The x.

yfloat

The y.

Inflates the specified rect.

C#
public static RectangleF Inflate(RectangleF rect, float x, float y)
Parameters:rectRectangleF

The rect.

xfloat

The x.

yfloat

The y.

Returns:

RectangleF

Inflates the specified size.

C#
public void Inflate(SizeF size)
Parameters:sizeSizeF

The size.

C#
public static RectangleF Intersect(RectangleF rectangle1, RectangleF rectangle2)
Parameters:rectangle1RectangleFrectangle2RectangleFReturns:

RectangleF

Intersects the specified rect.

C#
public void Intersect(RectangleF rect)
Parameters:rectRectangleF

The rect.

Determines whether this instance intersects with another rectangle.

C#
public bool IntersectsWith(RectangleF rect)
Parameters:rectRectangleF

The rect.

Returns:

bool

C#
public void Offset(float x, float y)
Parameters:xfloatyfloat
C#
public void Offset(PointF point)
Parameters:pointPointF
C#
public override string ToString()
Returns:

string

Overrides: ValueType.ToString()

C#
public static RectangleF Union(RectangleF rectangle1, RectangleF rectangle2)
Parameters:rectangle1RectangleFrectangle2RectangleFReturns:

RectangleF

Operators

C#
public static implicit operator RectangleF(Rect rect)
Parameters:rectRectReturns:

RectangleF

Implements the operator !=.

C#
public static bool operator !=(RectangleF left, RectangleF right)
Parameters:leftRectangleF

The left.

rightRectangleF

The right.

Returns:

bool

The result of the operator.

Implements the operator ==.

C#
public static bool operator ==(RectangleF left, RectangleF right)
Parameters:leftRectangleF

The left.

rightRectangleF

The right.

Returns:

bool

The result of the operator.

Extension Methods