ClassRectExtensions
Methods related to the Rect class.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Syntax:
public static class RectExtensions
Inheritance: objectRectExtensions
Properties
RotateTransform
Simple RotateTransform.
Declaration
public static RotateTransform RotateTransform { get; set; }
Property Value
RotateTransform
Methods
AroundPoint(Point, Point, double)
Around the point.
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, Point, double, Point)
Returns the rotated bottom left point.
Declaration
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
The angle.
pointOffset
Point
The point offset.
Returns
Point
BottomLeft(Rect, double, Point, Point)
Returns the bottom left point.
Declaration
public static Point BottomLeft(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
Parameters
rect
Rect
The rectangle.
angle
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
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
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
The angle.
pointOffset
Point
The point offset.
Returns
Point
BottomRight(Rect, double, Point, Point)
Returns the bottoms right point.
Declaration
public static Point BottomRight(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
Parameters
rect
Rect
The rectangle.
angle
The angle.
rotationOffset
Point
The rotation offset.
pointOffset
Point
The point offset.
Returns
Point
Center(Rect)
Returns the center of the specified rectangle.
Declaration
public static Point Center(this Rect rectangle)
Parameters
rectangle
Rect
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.
transformationOrigin
Point
The transform origin.
angle
The angle.
Returns
Point
Center(Rect, double, Point)
Returns the rotated center point.
Declaration
public static Point Center(this Rect rect, double angle, Point offsetVector = null)
Parameters
rect
Rect
The rectangle.
angle
The angle.
offsetVector
Point
The offset vector.
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 = null)
Parameters
rect
Rect
The rectangle.
angle
The angle.
offsetVector
Point
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 = null)
Parameters
rect
Rect
The rectangle.
angle
The angle.
offsetVector
Point
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 = null)
Parameters
rect
Rect
The object.
angle
The angle.
offsetVector
Point
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, Point, double, Point)
Returns the rotated top center point.
Declaration
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
The angle.
pointOffset
Point
The point offset.
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 = null, Point pointOffset = null)
Parameters
rect
Rect
The rectangle.
angle
The angle.
rotationOffset
Point
The rotation offset.
pointOffset
Point
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
CenterY(Rect)
Returns the Y coordinate of the center.
Declaration
public static double CenterY(this Rect rect)
Parameters
rect
Rect
The rectangle.
Returns
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.
origin
Point
The transformation origin.
angle
The angle.
Returns
True if [contains] [the specified rect]; otherwise, false.
Contains(Rect, Point, double)
Determines whether [contains] [the specified rect].
Contains(Rect, Rect)
Determines whether the specified rect1 contains the rect2 parameter.
Declaration
public static bool Contains(this Rect rect1, Rect rect2)
Parameters
rect1
Rect
rect2
Rect
Returns
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
InflateRect(Rect, double)
Inflates the given rectangle with the specified amount.
Declaration
public static Rect InflateRect(this Rect rect, double delta)
Parameters
rect
Rect
delta
Returns
Rect
InflateRect(Rect, double, double)
Inflates the given rectangle with the specified amount.
InflateRect(Rect, double, double, double, double)
Inflates the specified rectangle.
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
rectangle
Rect
point1
Point
point2
Point
Returns
Point
IntersectsLine(Rect, IList)
Returns whether the polyline intersects the rectangle.
IntersectsLineAtIndex(Rect, IList)
Returns the index in the list at which the given points intersects the polyline.
IntersectsLineSegment(Rect, Point, Point, ref Point)
Intersects the line segment.
Declaration
[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
IntersectsWith(Rect, Point, Rect, double)
Determines whether the start bounds intersect with the given rectangle.
IntersectsWith(Rect, Rect)
Returns whether the given rectangle intersects the current one.
Declaration
public static bool IntersectsWith(this Rect rect1, Rect rect2)
Parameters
rect1
Rect
The first rectangle.
rect2
Rect
The queried rectangle which potentially intersects.
Returns
IntersectsWith(Rect, Rect, double)
Intersects with.
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.
targetRect
Rect
The target rectangle.
Returns
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.
hostingRect
Rect
The hosting rectangle.
Returns
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
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
bounds
Rect
The bounds.
Returns
OffsetRect(Rect, Vector)
Offsets the specified rectangle.
Declaration
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.
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.
origin
Point
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.
offset
Point
The offset.
Returns
Point
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.
pivot
Point
The pivot.
angle
The angle.
Returns
Point[]
Rotate(Rect, double, Point)
Rotates the specified rectangle.
Declaration
public static Rect Rotate(this Rect rect, double angle, Point offsetVector = null)
Parameters
rect
Rect
The rectangle.
angle
The angle.
offsetVector
Point
The offset vector.
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.
origin
Point
The transformation origin.
angle
The angle.
Returns
Rect
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.
angle
The angle.
pivot
Point
The pivot.
Returns
Rect
RotationPoint(Rect, double, Point)
Rotations the point.
Declaration
public static Point RotationPoint(this Rect rect, double angle, Point offsetVector = null)
Parameters
rect
Rect
The rectangle.
angle
The angle.
offsetVector
Point
The offset vector.
Returns
Point
Shrink(Rect, double, double, double, double)
Shrinks the specified rectangle.
ToSize(Rect)
Toes the size.
Declaration
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
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
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
The angle.
pointOffset
Point
The point offset.
Returns
Point
TopLeft(Rect, double, Point, Point)
Returns the top left point.
Declaration
public static Point TopLeft(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
Parameters
rect
Rect
The rectangle.
angle
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
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
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
The angle.
pointOffset
Point
The point offset.
Returns
Point
TopRight(Rect, double, Point, Point)
Returns the top right point.
Declaration
public static Point TopRight(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
Parameters
rect
Rect
The rectangle.
angle
The angle.
rotationOffset
Point
The rotation offset.
pointOffset
Point
The point offset.
Returns
Point