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

Methods related to the Rect class.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

C#
public static class RectExtensions

Inheritance: objectRectExtensions

Properties

RotateTransform

RotateTransform

Simple RotateTransform.

C#
public static RotateTransform RotateTransform { get; set; }

Methods

Around the point.

C#
public static bool AroundPoint(this Point originPoint, Point point, double delta)
Parameters:originPointPoint

The origin point.

pointPoint

The point.

deltadouble

The delta.

Returns:

bool

Returns the bottom left point.

C#
public static Point BottomLeft(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

rotationOffsetPoint

The rotation offset.

pointOffsetPoint

The point offset.

Returns:

Point

Returns the rotated bottom left point.

C#
public static Point BottomLeft(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)
Parameters:rectRect

The rect.

transformationOriginPoint

The transform origin.

angledouble

The angle.

pointOffsetPoint

The point offset.

Returns:

Point

Returns the bottom-left point of the rectangle.

C#
public static Point BottomLeft(this Rect rect)
Parameters:rectRect

The current rectangle.

Returns:

Point

Returns the bottoms right point.

C#
public static Point BottomRight(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

rotationOffsetPoint

The rotation offset.

pointOffsetPoint

The point offset.

Returns:

Point

Returns the rotated bottom right point.

C#
public static Point BottomRight(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)
Parameters:rectRect

The rect.

transformationOriginPoint

The transform origin.

angledouble

The angle.

pointOffsetPoint

The point offset.

Returns:

Point

Returns the bottom-right corner of the rectangle.

C#
public static Point BottomRight(this Rect rect)
Parameters:rectRect

The current rectangle.

Returns:

Point

Returns the rotated center point.

C#
public static Point Center(this Rect rect, double angle, Point offsetVector = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

offsetVectorPoint

The offset vector.

Returns:

Point

Returns the rotated center point.

C#
public static Point Center(this Rect rect, Point transformationOrigin, double angle)
Parameters:rectRect

The rect.

transformationOriginPoint

The transform origin.

angledouble

The angle.

Returns:

Point

Returns the center of the specified rectangle.

C#
public static Point Center(this Rect rectangle)
Parameters:rectangleRectReturns:

Point

Centers the bottom.

C#
public static Point CenterBottom(this Rect rect, double angle, Point offsetVector = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

offsetVectorPoint

The offset vector.

Returns:

Point

Returns the bottom center point.

C#
public static Point CenterBottom(this Rect rect)
Parameters:rectRect

The rectangle.

Returns:

Point

Returns the rotated left center point.

C#
public static Point CenterLeft(this Rect rect, double angle, Point offsetVector = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

offsetVectorPoint

The offset vector.

Returns:

Point

Centers the left.

C#
public static Point CenterLeft(this Rect rect)
Parameters:rectRect

The rectangle.

Returns:

Point

Centers the right.

C#
public static Point CenterRight(this Rect rect, double angle, Point offsetVector = null)
Parameters:rectRect

The object.

angledouble

The angle.

offsetVectorPoint

The offset vector.

Returns:

Point

Centers the right.

C#
public static Point CenterRight(this Rect rect)
Parameters:rectRect

The rectangle.

Returns:

Point

Returns the rotated top center point.

C#
public static Point CenterTop(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

rotationOffsetPoint

The rotation offset.

pointOffsetPoint

The point offset.

Returns:

Point

Returns the rotated top center point.

C#
public static Point CenterTop(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)
Parameters:rectRect

The rect.

transformationOriginPoint

The rotation origin.

angledouble

The angle.

pointOffsetPoint

The point offset.

Returns:

Point

Centers the top.

C#
public static Point CenterTop(this Rect rect)
Parameters:rectRect

The rectangle.

Returns:

Point

Returns the X coordinate of the centers.

C#
public static double CenterX(this Rect rect)
Parameters:rectRect

The rectangle.

Returns:

double

Returns the Y coordinate of the center.

C#
public static double CenterY(this Rect rect)
Parameters:rectRect

The rectangle.

Returns:

double

Determines whether [contains] [the specified rect].

C#
public static bool Contains(this Rect rect, Point point, double angle)
Parameters:rectRect

The rect.

pointPoint

The point.

angledouble

The angle.

Returns:

bool

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

Determines whether [contains] [the specified rectangle].

C#
public static bool Contains(this Rect rect, Point point, Point origin, double angle)
Parameters:rectRect

The rectangle.

pointPoint

The point.

originPoint

The transformation origin.

angledouble

The angle.

Returns:

bool

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

Determines whether the specified rect1 contains the rect2 parameter.

C#
public static bool Contains(this Rect rect1, Rect rect2)
Parameters:rect1Rectrect2RectReturns:

bool

Inflates the specified rectangle.

C#
public static Rect InflateRect(this Rect rect, double left, double top, double right, double bottom)
Parameters:rectRect

The rectangle.

leftdouble

The left.

topdouble

The top.

rightdouble

The right.

bottomdouble

The bottom.

Returns:

Rect

Inflates the given rectangle with the specified amount.

C#
public static Rect InflateRect(this Rect rect, double deltaX, double deltaY)
Parameters:rectRectdeltaXdoubledeltaYdoubleReturns:

Rect

Inflates the given rectangle with the specified amount.

C#
public static Rect InflateRect(this Rect rect, double delta)
Parameters:rectRectdeltadoubleReturns:

Rect

Inflates the specified rectangle.

C#
public static Rect InflateRect(this Rect rect, Size size)
Parameters:rectRect

The rectangle.

sizeSize

The size.

Returns:

Rect

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

C#
public static Point IntersectionPoint(this Rect rectangle, Point point1, Point point2)
Parameters:rectangleRectpoint1Pointpoint2PointReturns:

Point

Returns whether the polyline intersects the rectangle.

C#
public static bool IntersectsLine(this Rect rect, IList polyline)
Parameters:rectRect

The rectangle to test intersection with.

polylineIList

The polyline which potentially intersects the rectangle.

Returns:

bool

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

C#
public static int IntersectsLineAtIndex(this Rect rect, IList polyline)
Parameters:rectRect

The rectangle test point.

polylineIList

The polyline.

Returns:

int

Intersects the line segment.

C#
public static bool IntersectsLineSegment(this Rect rect, Point lineStart, Point lineEnd, ref Point point)
Parameters:rectRectlineStartPointlineEndPointpointPointReturns:

bool

Determines whether the start bounds intersect with the given rectangle.

C#
public static bool IntersectsWith(this Rect startBounds, Point transformOrigin, Rect rect, double angle)
Parameters:startBoundsRect

The start bounds.

transformOriginPoint

The transformation origin.

rectRect

The rectangle.

angledouble

The angle.

Returns:

bool

Intersects with.

C#
public static bool IntersectsWith(this Rect shapeBounds, Rect rect, double angle)
Parameters:shapeBoundsRect

The shape bounds.

rectRect

The rectangle to intersect with.

angledouble

The rotation angle of the shapeBounds.

Returns:

bool

Returns whether the given rectangle intersects the current one.

C#
public static bool IntersectsWith(this Rect rect1, Rect rect2)
Parameters:rect1Rect

The first rectangle.

rect2Rect

The queried rectangle which potentially intersects.

Returns:

bool

Determines whether the specified rectangle is bigger.

C#
public static bool IsBigger(this Rect rect, Rect targetRect)
Parameters:rectRect

The rectangle.

targetRectRect

The target rectangle.

Returns:

bool

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

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

C#
public static bool IsInBounds(this Rect rect, Rect hostingRect)
Parameters:rectRect

The rectangle.

hostingRectRect

The hosting rectangle.

Returns:

bool

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

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

C#
public static bool IsNotZero(this Rect rect)
Parameters:rectRect

The rectangle.

Returns:

bool

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

Determines whether the bounds are valid.

C#
public static bool IsValidBounds(this Rect bounds)
Parameters:boundsRect

The bounds.

Returns:

bool

Offsets the current rectangle with the specified values.

C#
public static Rect OffsetRect(this Rect rect, double x, double y)
Parameters:rectRect

The rectangle to offset.

xdouble

The horizontal offset.

ydouble

The vertical offset.

Returns:

Rect

Offsets the specified rectangle.

C#
public static Rect OffsetRect(this Rect rect, Vector offsetVector)
Parameters:rectRect

The rectangle.

offsetVectorVector

The offset vector.

Returns:

Rect

Calculates the pivot point of the specified rectangle.

C#
public static Point Pivot(this Rect rect, Point origin)
Parameters:rectRect

The rect.

originPoint

The transformation origin.

Returns:

Point

Gets the relative point against the rectangle by offset.

C#
public static Point RelativePoint(this Rect rect, Point offset)
Parameters:rectRect

The rectangle.

offsetPoint

The offset.

Returns:

Point

Rotates the specified rectangle.

C#
public static Rect Rotate(this Rect rect, double angle, Point offsetVector = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

offsetVectorPoint

The offset vector.

Returns:

Rect

Rotates the specified rectangle.

C#
public static Point[] Rotate(this Rect rect, Point pivot, double angle)
Parameters:rectRect

The rectangle.

pivotPoint

The pivot.

angledouble

The angle.

Returns:

Point[]

Rotates the specified rectangle.

C#
public static Rect RotateRect(this Rect rect, double angle, Point pivot)
Parameters:rectRect

The rect.

angledouble

The angle.

pivotPoint

The pivot.

Returns:

Rect

Rotates the specified rect.

C#
public static Rect RotateRect(this Rect rect, Point origin, double angle)
Parameters:rectRect

The rect.

originPoint

The transformation origin.

angledouble

The angle.

Returns:

Rect

Rotations the point.

C#
public static Point RotationPoint(this Rect rect, double angle, Point offsetVector = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

offsetVectorPoint

The offset vector.

Returns:

Point

Shrinks the specified rectangle.

C#
public static Rect Shrink(this Rect rect, double left = 0, double top = 0, double right = 0, double bottom = 0)
Parameters:rectRect

The rectangle.

leftdouble

The left.

topdouble

The top.

rightdouble

The right.

bottomdouble

The bottom.

Returns:

Rect

Returns the top left point.

C#
public static Point TopLeft(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

rotationOffsetPoint

The rotation offset.

pointOffsetPoint

The point offset.

Returns:

Point

Returns the rotated top left point.

C#
public static Point TopLeft(this Rect rect, Point transformOrigin, double angle, Point pointOffset = null)
Parameters:rectRect

The rect.

transformOriginPoint

The transform origin.

angledouble

The angle.

pointOffsetPoint

The point offset.

Returns:

Point

Returns the top-left point of the rectangle.

C#
public static Point TopLeft(this Rect rect)
Parameters:rectRect

The current rectangle.

Returns:

Point

Returns the top right point.

C#
public static Point TopRight(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
Parameters:rectRect

The rectangle.

angledouble

The angle.

rotationOffsetPoint

The rotation offset.

pointOffsetPoint

The point offset.

Returns:

Point

Returns the rotated top right point.

C#
public static Point TopRight(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)
Parameters:rectRect

The rect.

transformationOriginPoint

The transform origin.

angledouble

The angle.

pointOffsetPoint

The point offset.

Returns:

Point

Returns the top-right point of the rectangle.

C#
public static Point TopRight(this Rect rect)
Parameters:rectRect

The current rectangle.

Returns:

Point

Toes the size.

C#
public static Size ToSize(this Rect rect)
Parameters:rectRect

The rectangle.

Returns:

Size

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