Class
RectExtensions

Methods related to the Rect class.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public static class RectExtensions

Inheritance: objectRectExtensions

Properties

RotateTransform

Simple RotateTransform.

Declaration

cs-api-definition
public static RotateTransform RotateTransform { get; set; }

Property Value

RotateTransform

Methods

AroundPoint(Point, Point, double)

Around the point.

Declaration

cs-api-definition
public static bool AroundPoint(this Point originPoint, Point point, double delta)

Parameters

originPoint

Point

The origin point.

point

Point

The point.

delta

double

The delta.

Returns

bool

BottomLeft(Rect)

Returns the bottom-left point of the rectangle.

Declaration

cs-api-definition
public static Point BottomLeft(this Rect rect)

Parameters

rect

Rect

The current rectangle.

Returns

Point

BottomLeft(Rect, Point, double, Point)

Returns the rotated bottom left point.

Declaration

cs-api-definition
public static Point BottomLeft(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)

Parameters

rect

Rect

The rect.

transformationOrigin

Point

The transform origin.

angle

double

The angle.

pointOffset

Point

The point offset.

Returns

Point

BottomLeft(Rect, double, Point, Point)

Returns the bottom left point.

Declaration

cs-api-definition
public static Point BottomLeft(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

rotationOffset

Point

The rotation offset.

pointOffset

Point

The point offset.

Returns

Point

BottomRight(Rect)

Returns the bottom-right corner of the rectangle.

Declaration

cs-api-definition
public static Point BottomRight(this Rect rect)

Parameters

rect

Rect

The current rectangle.

Returns

Point

BottomRight(Rect, Point, double, Point)

Returns the rotated bottom right point.

Declaration

cs-api-definition
public static Point BottomRight(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)

Parameters

rect

Rect

The rect.

transformationOrigin

Point

The transform origin.

angle

double

The angle.

pointOffset

Point

The point offset.

Returns

Point

BottomRight(Rect, double, Point, Point)

Returns the bottoms right point.

Declaration

cs-api-definition
public static Point BottomRight(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

rotationOffset

Point

The rotation offset.

pointOffset

Point

The point offset.

Returns

Point

Center(Rect)

Returns the center of the specified rectangle.

Declaration

cs-api-definition
public static Point Center(this Rect rectangle)

Parameters

rectangle

Rect

Returns

Point

Center(Rect, Point, double)

Returns the rotated center point.

Declaration

cs-api-definition
public static Point Center(this Rect rect, Point transformationOrigin, double angle)

Parameters

rect

Rect

The rect.

transformationOrigin

Point

The transform origin.

angle

double

The angle.

Returns

Point

Center(Rect, double, Point)

Returns the rotated center point.

Declaration

cs-api-definition
public static Point Center(this Rect rect, double angle, Point offsetVector = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

offsetVector

Point

The offset vector.

Returns

Point

CenterBottom(Rect)

Returns the bottom center point.

Declaration

cs-api-definition
public static Point CenterBottom(this Rect rect)

Parameters

rect

Rect

The rectangle.

Returns

Point

CenterBottom(Rect, double, Point)

Centers the bottom.

Declaration

cs-api-definition
public static Point CenterBottom(this Rect rect, double angle, Point offsetVector = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

offsetVector

Point

The offset vector.

Returns

Point

CenterLeft(Rect)

Centers the left.

Declaration

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

cs-api-definition
public static Point CenterLeft(this Rect rect, double angle, Point offsetVector = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

offsetVector

Point

The offset vector.

Returns

Point

CenterRight(Rect)

Centers the right.

Declaration

cs-api-definition
public static Point CenterRight(this Rect rect)

Parameters

rect

Rect

The rectangle.

Returns

Point

CenterRight(Rect, double, Point)

Centers the right.

Declaration

cs-api-definition
public static Point CenterRight(this Rect rect, double angle, Point offsetVector = null)

Parameters

rect

Rect

The object.

angle

double

The angle.

offsetVector

Point

The offset vector.

Returns

Point

CenterTop(Rect)

Centers the top.

Declaration

cs-api-definition
public static Point CenterTop(this Rect rect)

Parameters

rect

Rect

The rectangle.

Returns

Point

CenterTop(Rect, Point, double, Point)

Returns the rotated top center point.

Declaration

cs-api-definition
public static Point CenterTop(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)

Parameters

rect

Rect

The rect.

transformationOrigin

Point

The rotation origin.

angle

double

The angle.

pointOffset

Point

The point offset.

Returns

Point

CenterTop(Rect, double, Point, Point)

Returns the rotated top center point.

Declaration

cs-api-definition
public static Point CenterTop(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

rotationOffset

Point

The rotation offset.

pointOffset

Point

The point offset.

Returns

Point

CenterX(Rect)

Returns the X coordinate of the centers.

Declaration

cs-api-definition
public static double CenterX(this Rect rect)

Parameters

rect

Rect

The rectangle.

Returns

double

CenterY(Rect)

Returns the Y coordinate of the center.

Declaration

cs-api-definition
public static double CenterY(this Rect rect)

Parameters

rect

Rect

The rectangle.

Returns

double

Contains(Rect, Point, Point, double)

Determines whether [contains] [the specified rectangle].

Declaration

cs-api-definition
public static bool Contains(this Rect rect, Point point, Point origin, double angle)

Parameters

rect

Rect

The rectangle.

point

Point

The point.

origin

Point

The transformation origin.

angle

double

The angle.

Returns

bool

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

Contains(Rect, Point, double)

Determines whether [contains] [the specified rect].

Declaration

cs-api-definition
public static bool Contains(this Rect rect, Point point, double angle)

Parameters

rect

Rect

The rect.

point

Point

The point.

angle

double

The angle.

Returns

bool

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

Contains(Rect, Rect)

Determines whether the specified rect1 contains the rect2 parameter.

Declaration

cs-api-definition
public static bool Contains(this Rect rect1, Rect rect2)

Parameters

rect1

Rect

rect2

Rect

Returns

bool

InflateRect(Rect, Size)

Inflates the specified rectangle.

Declaration

cs-api-definition
public static Rect InflateRect(this Rect rect, Size size)

Parameters

rect

Rect

The rectangle.

size

Size

The size.

Returns

Rect

InflateRect(Rect, double)

Inflates the given rectangle with the specified amount.

Declaration

cs-api-definition
public static Rect InflateRect(this Rect rect, double delta)

Parameters

rect

Rect

delta

double

Returns

Rect

InflateRect(Rect, double, double)

Inflates the given rectangle with the specified amount.

Declaration

cs-api-definition
public static Rect InflateRect(this Rect rect, double deltaX, double deltaY)

Parameters

rect

Rect

deltaX

double

deltaY

double

Returns

Rect

InflateRect(Rect, double, double, double, double)

Inflates the specified rectangle.

Declaration

cs-api-definition
public static Rect InflateRect(this Rect rect, double left, double top, double right, double bottom)

Parameters

rect

Rect

The rectangle.

left

double

The left.

top

double

The top.

right

double

The right.

bottom

double

The bottom.

Returns

Rect

IntersectionPoint(Rect, Point, Point)

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

Declaration

cs-api-definition
public static Point IntersectionPoint(this Rect rectangle, Point point1, Point point2)

Parameters

rectangle

Rect

point1

Point

point2

Point

Returns

Point

IntersectsLine(Rect, IList)

Returns whether the polyline intersects the rectangle.

Declaration

cs-api-definition
public static bool IntersectsLine(this Rect rect, IList polyline)

Parameters

rect

Rect

The rectangle to test intersection with.

polyline

IList

The polyline which potentially intersects the rectangle.

Returns

bool

IntersectsLineAtIndex(Rect, IList)

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

Declaration

cs-api-definition
public static int IntersectsLineAtIndex(this Rect rect, IList polyline)

Parameters

rect

Rect

The rectangle test point.

polyline

IList

The polyline.

Returns

int

IntersectsLineSegment(Rect, Point, Point, ref Point)

Intersects the line segment.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
public static bool IntersectsLineSegment(this Rect rect, Point lineStart, Point lineEnd, ref Point point)

Parameters

rect

Rect

lineStart

Point

lineEnd

Point

point

Point

Returns

bool

IntersectsWith(Rect, Point, Rect, double)

Determines whether the start bounds intersect with the given rectangle.

Declaration

cs-api-definition
public static bool IntersectsWith(this Rect startBounds, Point transformOrigin, Rect rect, double angle)

Parameters

startBounds

Rect

The start bounds.

transformOrigin

Point

The transformation origin.

rect

Rect

The rectangle.

angle

double

The angle.

Returns

bool

IntersectsWith(Rect, Rect)

Returns whether the given rectangle intersects the current one.

Declaration

cs-api-definition
public static bool IntersectsWith(this Rect rect1, Rect rect2)

Parameters

rect1

Rect

The first rectangle.

rect2

Rect

The queried rectangle which potentially intersects.

Returns

bool

IntersectsWith(Rect, Rect, double)

Intersects with.

Declaration

cs-api-definition
public static bool IntersectsWith(this Rect shapeBounds, Rect rect, double angle)

Parameters

shapeBounds

Rect

The shape bounds.

rect

Rect

The rectangle to intersect with.

angle

double

The rotation angle of the shapeBounds.

Returns

bool

IsBigger(Rect, Rect)

Determines whether the specified rectangle is bigger.

Declaration

cs-api-definition
public static bool IsBigger(this Rect rect, Rect targetRect)

Parameters

rect

Rect

The rectangle.

targetRect

Rect

The target rectangle.

Returns

bool

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

cs-api-definition
public static bool IsInBounds(this Rect rect, Rect hostingRect)

Parameters

rect

Rect

The rectangle.

hostingRect

Rect

The hosting rectangle.

Returns

bool

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

cs-api-definition
public static bool IsNotZero(this Rect rect)

Parameters

rect

Rect

The rectangle.

Returns

bool

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

IsValidBounds(Rect)

Determines whether the bounds are valid.

Declaration

cs-api-definition
public static bool IsValidBounds(this Rect bounds)

Parameters

bounds

Rect

The bounds.

Returns

bool

OffsetRect(Rect, Vector)

Offsets the specified rectangle.

Declaration

cs-api-definition
public static Rect OffsetRect(this Rect rect, Vector offsetVector)

Parameters

rect

Rect

The rectangle.

offsetVector

Vector

The offset vector.

Returns

Rect

OffsetRect(Rect, double, double)

Offsets the current rectangle with the specified values.

Declaration

cs-api-definition
public static Rect OffsetRect(this Rect rect, double x, double y)

Parameters

rect

Rect

The rectangle to offset.

x

double

The horizontal offset.

y

double

The vertical offset.

Returns

Rect

Pivot(Rect, Point)

Calculates the pivot point of the specified rectangle.

Declaration

cs-api-definition
public static Point Pivot(this Rect rect, Point origin)

Parameters

rect

Rect

The rect.

origin

Point

The transformation origin.

Returns

Point

RelativePoint(Rect, Point)

Gets the relative point against the rectangle by offset.

Declaration

cs-api-definition
public static Point RelativePoint(this Rect rect, Point offset)

Parameters

rect

Rect

The rectangle.

offset

Point

The offset.

Returns

Point

Rotate(Rect, Point, double)

Rotates the specified rectangle.

Declaration

cs-api-definition
public static Point[] Rotate(this Rect rect, Point pivot, double angle)

Parameters

rect

Rect

The rectangle.

pivot

Point

The pivot.

angle

double

The angle.

Returns

Point[]

Rotate(Rect, double, Point)

Rotates the specified rectangle.

Declaration

cs-api-definition
public static Rect Rotate(this Rect rect, double angle, Point offsetVector = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

offsetVector

Point

The offset vector.

Returns

Rect

RotateRect(Rect, Point, double)

Rotates the specified rect.

Declaration

cs-api-definition
public static Rect RotateRect(this Rect rect, Point origin, double angle)

Parameters

rect

Rect

The rect.

origin

Point

The transformation origin.

angle

double

The angle.

Returns

Rect

RotateRect(Rect, double, Point)

Rotates the specified rectangle.

Declaration

cs-api-definition
public static Rect RotateRect(this Rect rect, double angle, Point pivot)

Parameters

rect

Rect

The rect.

angle

double

The angle.

pivot

Point

The pivot.

Returns

Rect

RotationPoint(Rect, double, Point)

Rotations the point.

Declaration

cs-api-definition
public static Point RotationPoint(this Rect rect, double angle, Point offsetVector = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

offsetVector

Point

The offset vector.

Returns

Point

Shrink(Rect, double, double, double, double)

Shrinks the specified rectangle.

Declaration

cs-api-definition
public static Rect Shrink(this Rect rect, double left = 0, double top = 0, double right = 0, double bottom = 0)

Parameters

rect

Rect

The rectangle.

left

double

The left.

top

double

The top.

right

double

The right.

bottom

double

The bottom.

Returns

Rect

ToSize(Rect)

Toes the size.

Declaration

cs-api-definition
public static Size ToSize(this Rect rect)

Parameters

rect

Rect

The rectangle.

Returns

Size

TopLeft(Rect)

Returns the top-left point of the rectangle.

Declaration

cs-api-definition
public static Point TopLeft(this Rect rect)

Parameters

rect

Rect

The current rectangle.

Returns

Point

TopLeft(Rect, Point, double, Point)

Returns the rotated top left point.

Declaration

cs-api-definition
public static Point TopLeft(this Rect rect, Point transformOrigin, double angle, Point pointOffset = null)

Parameters

rect

Rect

The rect.

transformOrigin

Point

The transform origin.

angle

double

The angle.

pointOffset

Point

The point offset.

Returns

Point

TopLeft(Rect, double, Point, Point)

Returns the top left point.

Declaration

cs-api-definition
public static Point TopLeft(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

rotationOffset

Point

The rotation offset.

pointOffset

Point

The point offset.

Returns

Point

TopRight(Rect)

Returns the top-right point of the rectangle.

Declaration

cs-api-definition
public static Point TopRight(this Rect rect)

Parameters

rect

Rect

The current rectangle.

Returns

Point

TopRight(Rect, Point, double, Point)

Returns the rotated top right point.

Declaration

cs-api-definition
public static Point TopRight(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)

Parameters

rect

Rect

The rect.

transformationOrigin

Point

The transform origin.

angle

double

The angle.

pointOffset

Point

The point offset.

Returns

Point

TopRight(Rect, double, Point, Point)

Returns the top right point.

Declaration

cs-api-definition
public static Point TopRight(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)

Parameters

rect

Rect

The rectangle.

angle

double

The angle.

rotationOffset

Point

The rotation offset.

pointOffset

Point

The point offset.

Returns

Point

In this article
DefinitionPropertiesRotateTransformMethodsAroundPoint(Point, Point, double)BottomLeft(Rect)BottomLeft(Rect, Point, double, Point)BottomLeft(Rect, double, Point, Point)BottomRight(Rect)BottomRight(Rect, Point, double, Point)BottomRight(Rect, double, Point, Point)Center(Rect)Center(Rect, Point, double)Center(Rect, double, Point)CenterBottom(Rect)CenterBottom(Rect, double, Point)CenterLeft(Rect)CenterLeft(Rect, double, Point)CenterRight(Rect)CenterRight(Rect, double, Point)CenterTop(Rect)CenterTop(Rect, Point, double, Point)CenterTop(Rect, double, Point, Point)CenterX(Rect)CenterY(Rect)Contains(Rect, Point, Point, double)Contains(Rect, Point, double)Contains(Rect, Rect)InflateRect(Rect, Size)InflateRect(Rect, double)InflateRect(Rect, double, double)InflateRect(Rect, double, double, double, double)IntersectionPoint(Rect, Point, Point)IntersectsLine(Rect, IList)IntersectsLineAtIndex(Rect, IList)IntersectsLineSegment(Rect, Point, Point, ref Point)IntersectsWith(Rect, Point, Rect, double)IntersectsWith(Rect, Rect)IntersectsWith(Rect, Rect, double)IsBigger(Rect, Rect)IsInBounds(Rect, Rect)IsNotZero(Rect)IsValidBounds(Rect)OffsetRect(Rect, Vector)OffsetRect(Rect, double, double)Pivot(Rect, Point)RelativePoint(Rect, Point)Rotate(Rect, Point, double)Rotate(Rect, double, Point)RotateRect(Rect, Point, double)RotateRect(Rect, double, Point)RotationPoint(Rect, double, Point)Shrink(Rect, double, double, double, double)ToSize(Rect)TopLeft(Rect)TopLeft(Rect, Point, double, Point)TopLeft(Rect, double, Point, Point)TopRight(Rect)TopRight(Rect, Point, double, Point)TopRight(Rect, double, Point, Point)
Not finding the help you need?
Contact Support