skip navigation
  • 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 Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX 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 Tools
    ThemeBuilder Design System Kit
    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
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class RectExtensions

Methods related to the Rect class.

Inheritance
System.Object
RectExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.WinControls.RadDiagram.dll

Syntax

public static class RectExtensions

Properties

RotateTransform

Simple RotateTransform.

Declaration
public static RotateTransform RotateTransform { get; set; }
Property Value
RotateTransform

Methods

AroundPoint(Point, Point, Double)

Around the point.

Declaration
public static bool AroundPoint(this Point originPoint, Point point, double delta)
Parameters
Point originPoint

The origin point.

Point point

The point.

System.Double delta

The delta.

Returns
System.Boolean

BottomLeft(Rect)

Returns the bottom-left point of the rectangle.

Declaration
public static Point BottomLeft(this Rect rect)
Parameters
Rect rect

The current rectangle.

Returns
Point

BottomLeft(Rect, Double, Point, Point)

Returns the bottom left point.

Declaration
public static Point BottomLeft(this Rect rect, double angle, Point rotationOffset = default(Point), Point pointOffset = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point rotationOffset

The rotation offset.

Point pointOffset

The point offset.

Returns
Point

BottomLeft(Rect, Point, Double, Point)

Returns the rotated bottom left point.

Declaration
public static Point BottomLeft(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = default(Point))
Parameters
Rect rect

The rect.

Point transformationOrigin

The transform origin.

System.Double angle

The angle.

Point pointOffset

The point offset.

Returns
Point

BottomRight(Rect)

Returns the bottom-right corner of the rectangle.

Declaration
public static Point BottomRight(this Rect rect)
Parameters
Rect rect

The current rectangle.

Returns
Point

BottomRight(Rect, Double, Point, Point)

Returns the bottoms right point.

Declaration
public static Point BottomRight(this Rect rect, double angle, Point rotationOffset = default(Point), Point pointOffset = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point rotationOffset

The rotation offset.

Point pointOffset

The point offset.

Returns
Point

BottomRight(Rect, Point, Double, Point)

Returns the rotated bottom right point.

Declaration
public static Point BottomRight(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = default(Point))
Parameters
Rect rect

The rect.

Point transformationOrigin

The transform origin.

System.Double angle

The angle.

Point pointOffset

The point offset.

Returns
Point

Center(Rect)

Returns the center of the specified rectangle.

Declaration
public static Point Center(this Rect rectangle)
Parameters
Rect rectangle

Returns
Point

Center(Rect, Double, Point)

Returns the rotated center point.

Declaration
public static Point Center(this Rect rect, double angle, Point offsetVector = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point offsetVector

The offset vector.

Returns
Point

Center(Rect, Point, Double)

Returns the rotated center point.

Declaration
public static Point Center(this Rect rect, Point transformationOrigin, double angle)
Parameters
Rect rect

The rect.

Point transformationOrigin

The transform origin.

System.Double angle

The angle.

Returns
Point

CenterBottom(Rect)

Returns the bottom center point.

Declaration
public static Point CenterBottom(this Rect rect)
Parameters
Rect rect

The rectangle.

Returns
Point

CenterBottom(Rect, Double, Point)

Centers the bottom.

Declaration
public static Point CenterBottom(this Rect rect, double angle, Point offsetVector = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point offsetVector

The offset vector.

Returns
Point

CenterLeft(Rect)

Centers the left.

Declaration
public static Point CenterLeft(this Rect rect)
Parameters
Rect rect

The rectangle.

Returns
Point

CenterLeft(Rect, Double, Point)

Returns the rotated left center point.

Declaration
public static Point CenterLeft(this Rect rect, double angle, Point offsetVector = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point offsetVector

The offset vector.

Returns
Point

CenterRight(Rect)

Centers the right.

Declaration
public static Point CenterRight(this Rect rect)
Parameters
Rect rect

The rectangle.

Returns
Point

CenterRight(Rect, Double, Point)

Centers the right.

Declaration
public static Point CenterRight(this Rect rect, double angle, Point offsetVector = default(Point))
Parameters
Rect rect

The object.

System.Double angle

The angle.

Point offsetVector

The offset vector.

Returns
Point

CenterTop(Rect)

Centers the top.

Declaration
public static Point CenterTop(this Rect rect)
Parameters
Rect rect

The rectangle.

Returns
Point

CenterTop(Rect, Double, Point, Point)

Returns the rotated top center point.

Declaration
public static Point CenterTop(this Rect rect, double angle, Point rotationOffset = default(Point), Point pointOffset = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point rotationOffset

The rotation offset.

Point pointOffset

The point offset.

Returns
Point

CenterTop(Rect, Point, Double, Point)

Returns the rotated top center point.

Declaration
public static Point CenterTop(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = default(Point))
Parameters
Rect rect

The rect.

Point transformationOrigin

The rotation origin.

System.Double angle

The angle.

Point pointOffset

The point offset.

Returns
Point

CenterX(Rect)

Returns the X coordinate of the centers.

Declaration
public static double CenterX(this Rect rect)
Parameters
Rect rect

The rectangle.

Returns
System.Double

CenterY(Rect)

Returns the Y coordinate of the center.

Declaration
public static double CenterY(this Rect rect)
Parameters
Rect rect

The rectangle.

Returns
System.Double

Contains(Rect, Point, Double)

Determines whether [contains] [the specified rect].

Declaration
public static bool Contains(this Rect rect, Point point, double angle)
Parameters
Rect rect

The rect.

Point point

The point.

System.Double angle

The angle.

Returns
System.Boolean

True if [contains] [the specified rect]; otherwise, false.

Contains(Rect, Point, Point, Double)

Determines whether [contains] [the specified rectangle].

Declaration
public static bool Contains(this Rect rect, Point point, Point origin, double angle)
Parameters
Rect rect

The rectangle.

Point point

The point.

Point origin

The transformation origin.

System.Double angle

The angle.

Returns
System.Boolean

True if [contains] [the specified rect]; otherwise, false.

Contains(Rect, Rect)

Determines whether the specified rect1 contains the rect2 parameter.

Declaration
public static bool Contains(this Rect rect1, Rect rect2)
Parameters
Rect rect1

Rect rect2

Returns
System.Boolean

InflateRect(Rect, Double)

Inflates the given rectangle with the specified amount.

Declaration
public static Rect InflateRect(this Rect rect, double delta)
Parameters
Rect rect

System.Double delta

Returns
Rect

InflateRect(Rect, Double, Double)

Inflates the given rectangle with the specified amount.

Declaration
public static Rect InflateRect(this Rect rect, double deltaX, double deltaY)
Parameters
Rect rect

System.Double deltaX

System.Double deltaY

Returns
Rect

InflateRect(Rect, Double, Double, Double, Double)

Inflates the specified rectangle.

Declaration
public static Rect InflateRect(this Rect rect, double left, double top, double right, double bottom)
Parameters
Rect rect

The rectangle.

System.Double left

The left.

System.Double top

The top.

System.Double right

The right.

System.Double bottom

The bottom.

Returns
Rect

InflateRect(Rect, Size)

Inflates the specified rectangle.

Declaration
public static Rect InflateRect(this Rect rect, Size size)
Parameters
Rect rect

The rectangle.

Size size

The size.

Returns
Rect

IntersectionPoint(Rect, Point, Point)

Calculate the intersection point between an ellipse and a line segment.

Declaration
public static Point IntersectionPoint(this Rect rectangle, Point point1, Point point2)
Parameters
Rect rectangle

Point point1

Point point2

Returns
Point

IntersectsLine(Rect, IList)

Returns whether the polyline intersects the rectangle.

Declaration
public static bool IntersectsLine(this Rect rect, IList polyline)
Parameters
Rect rect

The rectangle to test intersection with.

System.Collections.IList polyline

The polyline which potentially intersects the rectangle.

Returns
System.Boolean

IntersectsLineAtIndex(Rect, IList)

Returns the index in the list at which the given points intersects the polyline.

Declaration
public static int IntersectsLineAtIndex(this Rect rect, IList polyline)
Parameters
Rect rect

The rectangle test point.

System.Collections.IList polyline

The polyline.

Returns
System.Int32

IntersectsLineSegment(Rect, Point, Point, ref Point)

Intersects the line segment.

Declaration
public static bool IntersectsLineSegment(this Rect rect, Point lineStart, Point lineEnd, ref Point point)
Parameters
Rect rect

Point lineStart

Point lineEnd

Point point

Returns
System.Boolean

IntersectsWith(Rect, Point, Rect, Double)

Determines whether the start bounds intersect with the given rectangle.

Declaration
public static bool IntersectsWith(this Rect startBounds, Point transformOrigin, Rect rect, double angle)
Parameters
Rect startBounds

The start bounds.

Point transformOrigin

The transformation origin.

Rect rect

The rectangle.

System.Double angle

The angle.

Returns
System.Boolean

IntersectsWith(Rect, Rect)

Returns whether the given rectangle intersects the current one.

Declaration
public static bool IntersectsWith(this Rect rect1, Rect rect2)
Parameters
Rect rect1

The first rectangle.

Rect rect2

The queried rectangle which potentially intersects.

Returns
System.Boolean

IntersectsWith(Rect, Rect, Double)

Intersects with.

Declaration
public static bool IntersectsWith(this Rect shapeBounds, Rect rect, double angle)
Parameters
Rect shapeBounds

The shape bounds.

Rect rect

The rectangle to intersect with.

System.Double angle

The rotation angle of the shapeBounds.

Returns
System.Boolean

IsBigger(Rect, Rect)

Determines whether the specified rectangle is bigger.

Declaration
public static bool IsBigger(this Rect rect, Rect targetRect)
Parameters
Rect rect

The rectangle.

Rect targetRect

The target rectangle.

Returns
System.Boolean

True if the specified rectangle is bigger; otherwise, false.

IsInBounds(Rect, Rect)

Gets whether the rectangle is fully in bounds of the hosting rectangle.

Declaration
public static bool IsInBounds(this Rect rect, Rect hostingRect)
Parameters
Rect rect

The rectangle.

Rect hostingRect

The hosting rectangle.

Returns
System.Boolean

Returns true if the rectangle is fully inside the bounds for the hosting rectangle.

IsNotZero(Rect)

Determines whether the specified rect is zero - does not have size.

Declaration
public static bool IsNotZero(this Rect rect)
Parameters
Rect rect

The rectangle.

Returns
System.Boolean

True if the specified rect is zero; otherwise, false.

IsValidBounds(Rect)

Determines whether the bounds are valid.

Declaration
public static bool IsValidBounds(this Rect bounds)
Parameters
Rect bounds

The bounds.

Returns
System.Boolean

OffsetRect(Rect, Double, Double)

Offsets the current rectangle with the specified values.

Declaration
public static Rect OffsetRect(this Rect rect, double x, double y)
Parameters
Rect rect

The rectangle to offset.

System.Double x

The horizontal offset.

System.Double y

The vertical offset.

Returns
Rect

OffsetRect(Rect, Vector)

Offsets the specified rectangle.

Declaration
public static Rect OffsetRect(this Rect rect, Vector offsetVector)
Parameters
Rect rect

The rectangle.

Vector offsetVector

The offset vector.

Returns
Rect

Pivot(Rect, Point)

Calculates the pivot point of the specified rectangle.

Declaration
public static Point Pivot(this Rect rect, Point origin)
Parameters
Rect rect

The rect.

Point origin

The transformation origin.

Returns
Point

RelativePoint(Rect, Point)

Gets the relative point against the rectangle by offset.

Declaration
public static Point RelativePoint(this Rect rect, Point offset)
Parameters
Rect rect

The rectangle.

Point offset

The offset.

Returns
Point

Rotate(Rect, Double, Point)

Rotates the specified rectangle.

Declaration
public static Rect Rotate(this Rect rect, double angle, Point offsetVector = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point offsetVector

The offset vector.

Returns
Rect

Rotate(Rect, Point, Double)

Rotates the specified rectangle.

Declaration
public static Point[] Rotate(this Rect rect, Point pivot, double angle)
Parameters
Rect rect

The rectangle.

Point pivot

The pivot.

System.Double angle

The angle.

Returns
Point[]

RotateRect(Rect, Double, Point)

Rotates the specified rectangle.

Declaration
public static Rect RotateRect(this Rect rect, double angle, Point pivot)
Parameters
Rect rect

The rect.

System.Double angle

The angle.

Point pivot

The pivot.

Returns
Rect

RotateRect(Rect, Point, Double)

Rotates the specified rect.

Declaration
public static Rect RotateRect(this Rect rect, Point origin, double angle)
Parameters
Rect rect

The rect.

Point origin

The transformation origin.

System.Double angle

The angle.

Returns
Rect

RotationPoint(Rect, Double, Point)

Rotations the point.

Declaration
public static Point RotationPoint(this Rect rect, double angle, Point offsetVector = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point offsetVector

The offset vector.

Returns
Point

Shrink(Rect, Double, Double, Double, Double)

Shrinks the specified rectangle.

Declaration
public static Rect Shrink(this Rect rect, double left = 0, double top = 0, double right = 0, double bottom = 0)
Parameters
Rect rect

The rectangle.

System.Double left

The left.

System.Double top

The top.

System.Double right

The right.

System.Double bottom

The bottom.

Returns
Rect

TopLeft(Rect)

Returns the top-left point of the rectangle.

Declaration
public static Point TopLeft(this Rect rect)
Parameters
Rect rect

The current rectangle.

Returns
Point

TopLeft(Rect, Double, Point, Point)

Returns the top left point.

Declaration
public static Point TopLeft(this Rect rect, double angle, Point rotationOffset = default(Point), Point pointOffset = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point rotationOffset

The rotation offset.

Point pointOffset

The point offset.

Returns
Point

TopLeft(Rect, Point, Double, Point)

Returns the rotated top left point.

Declaration
public static Point TopLeft(this Rect rect, Point transformOrigin, double angle, Point pointOffset = default(Point))
Parameters
Rect rect

The rect.

Point transformOrigin

The transform origin.

System.Double angle

The angle.

Point pointOffset

The point offset.

Returns
Point

TopRight(Rect)

Returns the top-right point of the rectangle.

Declaration
public static Point TopRight(this Rect rect)
Parameters
Rect rect

The current rectangle.

Returns
Point

TopRight(Rect, Double, Point, Point)

Returns the top right point.

Declaration
public static Point TopRight(this Rect rect, double angle, Point rotationOffset = default(Point), Point pointOffset = default(Point))
Parameters
Rect rect

The rectangle.

System.Double angle

The angle.

Point rotationOffset

The rotation offset.

Point pointOffset

The point offset.

Returns
Point

TopRight(Rect, Point, Double, Point)

Returns the rotated top right point.

Declaration
public static Point TopRight(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = default(Point))
Parameters
Rect rect

The rect.

Point transformationOrigin

The transform origin.

System.Double angle

The angle.

Point pointOffset

The point offset.

Returns
Point

ToSize(Rect)

Toes the size.

Declaration
public static Size ToSize(this Rect rect)
Parameters
Rect rect

The rectangle.

Returns
Size

Was this article helpful?

Tell us how we can improve this article

Skip
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • 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.