Class RectExtensions
Methods related to the System.Windows.Rect class.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll
Syntax
public static class RectExtensions
Properties
RotateTransform
Simple RotateTransform.
Declaration
public static RotateTransform RotateTransform { get; set; }
Property Value
System.Windows.Media.RotateTransform
|
Methods
AroundPoint(Point, Point, Double)
Around the point.
Declaration
public static bool AroundPoint(this Point originPoint, Point point, double delta)
Parameters
System.Windows.Point
originPoint
The origin point. |
System.Windows.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
System.Windows.Rect
rect
The current rectangle. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
rotationOffset
The rotation offset. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rect. |
System.Windows.Point
transformationOrigin
The transform origin. |
System.Double
angle
The angle. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.Point
|
BottomRight(Rect)
Returns the bottom-right corner of the rectangle.
Declaration
public static Point BottomRight(this Rect rect)
Parameters
System.Windows.Rect
rect
The current rectangle. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
rotationOffset
The rotation offset. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rect. |
System.Windows.Point
transformationOrigin
The transform origin. |
System.Double
angle
The angle. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.Point
|
Center(Rect)
Returns the center of the specified rectangle.
Declaration
public static Point Center(this Rect rectangle)
Parameters
System.Windows.Rect
rectangle
|
Returns
System.Windows.Point
|
Center(Rect, Double, Point)
Returns the rotated center point.
Declaration
public static Point Center(this Rect rect, double angle, Point offsetVector = null)
Parameters
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
offsetVector
The offset vector. |
Returns
System.Windows.Point
|
Center(Rect, Point, Double)
Returns the rotated center point.
Declaration
public static Point Center(this Rect rect, Point transformationOrigin, double angle)
Parameters
System.Windows.Rect
rect
The rect. |
System.Windows.Point
transformationOrigin
The transform origin. |
System.Double
angle
The angle. |
Returns
System.Windows.Point
|
CenterBottom(Rect)
Returns the bottom center point.
Declaration
public static Point CenterBottom(this Rect rect)
Parameters
System.Windows.Rect
rect
The rectangle. |
Returns
System.Windows.Point
|
CenterBottom(Rect, Double, Point)
Centers the bottom.
Declaration
public static Point CenterBottom(this Rect rect, double angle, Point offsetVector = null)
Parameters
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
offsetVector
The offset vector. |
Returns
System.Windows.Point
|
CenterLeft(Rect)
Centers the left.
Declaration
public static Point CenterLeft(this Rect rect)
Parameters
System.Windows.Rect
rect
The rectangle. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
offsetVector
The offset vector. |
Returns
System.Windows.Point
|
CenterRight(Rect)
Centers the right.
Declaration
public static Point CenterRight(this Rect rect)
Parameters
System.Windows.Rect
rect
The rectangle. |
Returns
System.Windows.Point
|
CenterRight(Rect, Double, Point)
Centers the right.
Declaration
public static Point CenterRight(this Rect rect, double angle, Point offsetVector = null)
Parameters
System.Windows.Rect
rect
The object. |
System.Double
angle
The angle. |
System.Windows.Point
offsetVector
The offset vector. |
Returns
System.Windows.Point
|
CenterTop(Rect)
Centers the top.
Declaration
public static Point CenterTop(this Rect rect)
Parameters
System.Windows.Rect
rect
The rectangle. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
rotationOffset
The rotation offset. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rect. |
System.Windows.Point
transformationOrigin
The rotation origin. |
System.Double
angle
The angle. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.Point
|
CenterX(Rect)
Returns the X coordinate of the centers.
Declaration
public static double CenterX(this Rect rect)
Parameters
System.Windows.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
System.Windows.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
System.Windows.Rect
rect
The rect. |
System.Windows.Point
point
The point. |
System.Double
angle
The angle. |
Returns
System.Boolean
|
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
System.Windows.Rect
rect
The rectangle. |
System.Windows.Point
point
The point. |
System.Windows.Point
origin
The transformation origin. |
System.Double
angle
The angle. |
Returns
System.Boolean
|
Contains(Rect, Rect)
Determines whether the specified rect1 contains the rect2 parameter.
Declaration
public static bool Contains(this Rect rect1, Rect rect2)
Parameters
System.Windows.Rect
rect1
|
System.Windows.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
System.Windows.Rect
rect
|
System.Double
delta
|
Returns
System.Windows.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
System.Windows.Rect
rect
|
System.Double
deltaX
|
System.Double
deltaY
|
Returns
System.Windows.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
System.Windows.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
System.Windows.Rect
|
InflateRect(Rect, Size)
Inflates the specified rectangle.
Declaration
public static Rect InflateRect(this Rect rect, Size size)
Parameters
System.Windows.Rect
rect
The rectangle. |
System.Windows.Size
size
The size. |
Returns
System.Windows.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
System.Windows.Rect
rectangle
|
System.Windows.Point
point1
|
System.Windows.Point
point2
|
Returns
System.Windows.Point
|
IntersectsLine(Rect, IList)
Returns whether the polyline intersects the rectangle.
Declaration
public static bool IntersectsLine(this Rect rect, IList polyline)
Parameters
System.Windows.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
System.Windows.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
System.Windows.Rect
rect
|
System.Windows.Point
lineStart
|
System.Windows.Point
lineEnd
|
System.Windows.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
System.Windows.Rect
startBounds
The start bounds. |
System.Windows.Point
transformOrigin
The transformation origin. |
System.Windows.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
System.Windows.Rect
rect1
The first rectangle. |
System.Windows.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
System.Windows.Rect
shapeBounds
The shape bounds. |
System.Windows.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
System.Windows.Rect
rect
The rectangle. |
System.Windows.Rect
targetRect
The target rectangle. |
Returns
System.Boolean
|
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
System.Windows.Rect
rect
The rectangle. |
System.Windows.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
System.Windows.Rect
rect
The rectangle. |
Returns
System.Boolean
|
IsValidBounds(Rect)
Determines whether the bounds are valid.
Declaration
public static bool IsValidBounds(this Rect bounds)
Parameters
System.Windows.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
System.Windows.Rect
rect
The rectangle to offset. |
System.Double
x
The horizontal offset. |
System.Double
y
The vertical offset. |
Returns
System.Windows.Rect
|
OffsetRect(Rect, Vector)
Offsets the specified rectangle.
Declaration
public static Rect OffsetRect(this Rect rect, Vector offsetVector)
Parameters
System.Windows.Rect
rect
The rectangle. |
System.Windows.Vector
offsetVector
The offset vector. |
Returns
System.Windows.Rect
|
Pivot(Rect, Point)
Calculates the pivot point of the specified rectangle.
Declaration
public static Point Pivot(this Rect rect, Point origin)
Parameters
System.Windows.Rect
rect
The rect. |
System.Windows.Point
origin
The transformation origin. |
Returns
System.Windows.Point
|
RelativePoint(Rect, Point)
Gets the relative point against the rectangle by offset.
Declaration
public static Point RelativePoint(this Rect rect, Point offset)
Parameters
System.Windows.Rect
rect
The rectangle. |
System.Windows.Point
offset
The offset. |
Returns
System.Windows.Point
|
Rotate(Rect, Double, Point)
Rotates the specified rectangle.
Declaration
public static Rect Rotate(this Rect rect, double angle, Point offsetVector = null)
Parameters
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
offsetVector
The offset vector. |
Returns
System.Windows.Rect
|
Rotate(Rect, Point, Double)
Rotates the specified rectangle.
Declaration
public static Point[] Rotate(this Rect rect, Point pivot, double angle)
Parameters
System.Windows.Rect
rect
The rectangle. |
System.Windows.Point
pivot
The pivot. |
System.Double
angle
The angle. |
Returns
System.Windows.Point[]
|
RotateRect(Rect, Double, Point)
Rotates the specified rectangle.
Declaration
public static Rect RotateRect(this Rect rect, double angle, Point pivot)
Parameters
System.Windows.Rect
rect
The rect. |
System.Double
angle
The angle. |
System.Windows.Point
pivot
The pivot. |
Returns
System.Windows.Rect
|
RotateRect(Rect, Point, Double)
Rotates the specified rect.
Declaration
public static Rect RotateRect(this Rect rect, Point origin, double angle)
Parameters
System.Windows.Rect
rect
The rect. |
System.Windows.Point
origin
The transformation origin. |
System.Double
angle
The angle. |
Returns
System.Windows.Rect
|
RotationPoint(Rect, Double, Point)
Rotations the point.
Declaration
public static Point RotationPoint(this Rect rect, double angle, Point offsetVector = null)
Parameters
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
offsetVector
The offset vector. |
Returns
System.Windows.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
System.Windows.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
System.Windows.Rect
|
TopLeft(Rect)
Returns the top-left point of the rectangle.
Declaration
public static Point TopLeft(this Rect rect)
Parameters
System.Windows.Rect
rect
The current rectangle. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
rotationOffset
The rotation offset. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rect. |
System.Windows.Point
transformOrigin
The transform origin. |
System.Double
angle
The angle. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.Point
|
TopRight(Rect)
Returns the top-right point of the rectangle.
Declaration
public static Point TopRight(this Rect rect)
Parameters
System.Windows.Rect
rect
The current rectangle. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rectangle. |
System.Double
angle
The angle. |
System.Windows.Point
rotationOffset
The rotation offset. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.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
System.Windows.Rect
rect
The rect. |
System.Windows.Point
transformationOrigin
The transform origin. |
System.Double
angle
The angle. |
System.Windows.Point
pointOffset
The point offset. |
Returns
System.Windows.Point
|
ToSize(Rect)
Toes the size.
Declaration
public static Size ToSize(this Rect rect)
Parameters
System.Windows.Rect
rect
The rectangle. |
Returns
System.Windows.Size
|