• Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Design
    Unite UX
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Struct RectangleF

Describes a rectanlge using float units.

Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Telerik.Windows.Documents.Model
Assembly: Telerik.Windows.Documents.dll

Syntax

public struct RectangleF

Constructors

RectangleF(Single, Single, Single, Single)

Initializes a new instance of the RectangleF struct.

Declaration
public RectangleF(float x, float y, float width, float height)
Parameters
System.Single x

The x position.

System.Single y

The y position.

System.Single width

The width.

System.Single height

The height.

RectangleF(PointF, SizeF)

Initializes a new instance of the RectangleF struct.

Declaration
public RectangleF(PointF location, SizeF size)
Parameters
PointF location

The location.

SizeF size

The size.

Fields

Empty

Empty rectangle.

Declaration
public static readonly RectangleF Empty
Field Value
RectangleF

Properties

Bottom

Gets the bottom.

Declaration
public float Bottom { get; }
Property Value
System.Single

The bottom.

Center

Declaration
public PointF Center { get; }
Property Value
PointF

Height

Gets or sets the height.

Declaration
public float Height { get; set; }
Property Value
System.Single

The height.

IsEmpty

Gets a value indicating whether this instance is empty.

Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean

true if this instance is empty; otherwise, false.

Left

Gets the left.

Declaration
public float Left { get; }
Property Value
System.Single

The left.

Location

Gets or sets the location.

Declaration
public PointF Location { get; set; }
Property Value
PointF

The location.

Right

Gets the right.

Declaration
public float Right { get; }
Property Value
System.Single

The right.

Size

Gets or sets the size.

Declaration
public SizeF Size { get; set; }
Property Value
SizeF

The size.

Top

Gets the top.

Declaration
public float Top { get; }
Property Value
System.Single

The top.

Width

Gets or sets the width.

Declaration
public float Width { get; set; }
Property Value
System.Single

The width.

X

Gets or sets the x position.

Declaration
public float X { get; set; }
Property Value
System.Single

The x position.

Y

Gets or sets the y position.

Declaration
public float Y { get; set; }
Property Value
System.Single

The y position.

Methods

Contains(Single, Single)

Determines whether this instance contains a point.

Declaration
public bool Contains(float x, float y)
Parameters
System.Single x

The x-coordinate of the point.

System.Single y

The y-coordinate of the point.

Returns
System.Boolean

true if contains the specified coordinates; otherwise, false.

Contains(PointF)

Determines whether this instance contains a point.

Declaration
public bool Contains(PointF point)
Parameters
PointF point

The point.

Returns
System.Boolean

true if contains the specified point; otherwise, false.

Contains(RectangleF)

Determines whether this instance contains the object.

Declaration
public bool Contains(RectangleF rect)
Parameters
RectangleF rect

The rect.

Returns
System.Boolean

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

Equals(Object)

Determines whether the specified System.Object, is equal to this instance.

Declaration
public override bool Equals(object obj)
Parameters
System.Object obj

The System.Object to compare with this instance.

Returns
System.Boolean

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

Overrides
System.ValueType.Equals(System.Object)

FromLtrb(Double, Double, Double, Double)

Froms the LTRB.

Declaration
public static RectangleF FromLtrb(double left, double top, double right, double bottom)
Parameters
System.Double left

The left.

System.Double top

The top.

System.Double right

The right.

System.Double bottom

The bottom.

Returns
RectangleF

GetHashCode()

Returns a hash code for this instance.

Declaration
public override int GetHashCode()
Returns
System.Int32

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Overrides
System.ValueType.GetHashCode()

GetRoundedCopy(Int32)

Declaration
public RectangleF GetRoundedCopy(int decimals)
Parameters
System.Int32 decimals

Returns
RectangleF

Inflate(Single, Single)

Inflates the specified x and y coordinates.

Declaration
public void Inflate(float x, float y)
Parameters
System.Single x

The x.

System.Single y

The y.

Inflate(RectangleF, Single, Single)

Inflates the specified rect.

Declaration
public static RectangleF Inflate(RectangleF rect, float x, float y)
Parameters
RectangleF rect

The rect.

System.Single x

The x.

System.Single y

The y.

Returns
RectangleF

Inflate(SizeF)

Inflates the specified size.

Declaration
public void Inflate(SizeF size)
Parameters
SizeF size

The size.

Intersect(RectangleF)

Intersects the specified rect.

Declaration
public void Intersect(RectangleF rect)
Parameters
RectangleF rect

The rect.

Intersect(RectangleF, RectangleF)

Declaration
public static RectangleF Intersect(RectangleF rectangle1, RectangleF rectangle2)
Parameters
RectangleF rectangle1

RectangleF rectangle2

Returns
RectangleF

IntersectsWith(RectangleF)

Determines whether this instance intersects with another rectangle.

Declaration
public bool IntersectsWith(RectangleF rect)
Parameters
RectangleF rect

The rect.

Returns
System.Boolean

Offset(Single, Single)

Declaration
public void Offset(float x, float y)
Parameters
System.Single x

System.Single y

Offset(PointF)

Declaration
public void Offset(PointF point)
Parameters
PointF point

ToString()

Declaration
public override string ToString()
Returns
System.String

Overrides
System.ValueType.ToString()

Union(RectangleF, RectangleF)

Declaration
public static RectangleF Union(RectangleF rectangle1, RectangleF rectangle2)
Parameters
RectangleF rectangle1

RectangleF rectangle2

Returns
RectangleF

Operators

Equality(RectangleF, RectangleF)

Implements the operator ==.

Declaration
public static bool operator ==(RectangleF left, RectangleF right)
Parameters
RectangleF left

The left.

RectangleF right

The right.

Returns
System.Boolean

The result of the operator.

Implicit(Rect to RectangleF)

Declaration
public static implicit operator RectangleF(Rect rect)
Parameters
System.Windows.Rect rect

Returns
RectangleF

Inequality(RectangleF, RectangleF)

Implements the operator !=.

Declaration
public static bool operator !=(RectangleF left, RectangleF right)
Parameters
RectangleF left

The left.

RectangleF right

The right.

Returns
System.Boolean

The result of the operator.

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
ExtensionMethods.AreClose(RectangleF, RectangleF)
ExtensionMethods.ToRect(RectangleF)
EnumerableExtensions.ToEnumerable<T>(T)

Was this article helpful?

Tell us how we can improve this article

Skip
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.