Struct RadRect
Represents a Rectangle in the Euclidean plane geometry.
Inherited Members
Namespace: Telerik.Charting
Assembly: Telerik.WinControls.dll
Syntax
public struct RadRect
Constructors
RadRect(Double, Double)
Initializes a new instance of the RadRect struct.
Declaration
public RadRect(double width, double height)
Parameters
System.Double
width
The width. |
System.Double
height
The height. |
RadRect(Double, Double, Double, Double)
Initializes a new instance of the RadRect struct.
Declaration
public RadRect(double x, double y, double width, double height)
Parameters
System.Double
x
The x. |
System.Double
y
The y. |
System.Double
width
The width. |
System.Double
height
The height. |
RadRect(RadPoint, RadPoint)
Initializes a new instance of the RadRect struct.
Declaration
public RadRect(RadPoint point1, RadPoint point2)
Parameters
RadPoint
point1
The point1. |
RadPoint
point2
The point2. |
Fields
Empty
Empty rectangle which values are zeroes.
Declaration
public static readonly RadRect Empty
Field Value
RadRect
|
Height
The length of the rectangle along the Y-axis.
Declaration
public double Height
Field Value
System.Double
|
Invalid
Invalid rectangle, which Width and Height properties are set to (-1).
Declaration
public static readonly RadRect Invalid
Field Value
RadRect
|
Width
The length of the rectangle along the X-axis.
Declaration
public double Width
Field Value
System.Double
|
X
The X-coordinate of the rectangle.
Declaration
public double X
Field Value
System.Double
|
Y
The Y-coordinate of the rectangle.
Declaration
public double Y
Field Value
System.Double
|
Properties
Bottom
Gets the Y-coordinate of the bottom side of the rectangle.
Declaration
public double Bottom { get; }
Property Value
System.Double
|
Center
Gets the center of this rectangle.
Declaration
public RadPoint Center { get; }
Property Value
RadPoint
|
Location
Gets the location (Top-Left corner) of the rectangle.
Declaration
public RadPoint Location { get; }
Property Value
RadPoint
|
Right
Gets the X-coordinate of the right side of the rectangle.
Declaration
public double Right { get; }
Property Value
System.Double
|
Methods
CenterRect(RadRect, RadRect)
Centers the specified rectangle within the provided available one.
Declaration
public static RadRect CenterRect(RadRect rect, RadRect bounds)
Parameters
RadRect
rect
|
RadRect
bounds
|
Returns
RadRect
|
Contains(Double, Double)
Determines if this RadRect instance contains the point that is described by the arguments.
Declaration
public bool Contains(double x, double y)
Parameters
System.Double
x
The X coordinate of the point to check. |
System.Double
y
The Y coordinate of the point to check. |
Returns
System.Boolean
Returns true if this rectangle contains the point from the arguments and false otherwise. |
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
The System.Object to compare with this instance. |
Returns
System.Boolean
|
Overrides
Floor(RadRect)
Rounds the rectangle's value to the closest less than or equal to whole numbers.
Declaration
public static RadRect Floor(RadRect rect)
Parameters
RadRect
rect
|
Returns
RadRect
|
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System.Int32
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
IntersectsWith(RadRect)
Determines whether the current rect intersects with the specified one.
Declaration
public bool IntersectsWith(RadRect rect)
Parameters
RadRect
rect
|
Returns
System.Boolean
|
IsSizeValid()
Determines whether the size of this rect is valid - that is both Width and Height should be bigger than zero.
Declaration
public bool IsSizeValid()
Returns
System.Boolean
|
Round(RadRect)
Rounds the rectangle's values by respecting the Width and Height.
Declaration
public static RadRect Round(RadRect rect)
Parameters
RadRect
rect
The RadRect that will be rounded. |
Returns
RadRect
A new instance of RadRect with rounded values. |
RoundByRespectingLocation(Double, Double, Double, Double)
Rounds the rectangle's values by respecting the X and Right and respecting the Y and Bottom. (0.4, 0, 2.2, 0) results in (0, 0, 3, 0). Note: original width = 3, result width = 2.2; original right = 2.6, result right = 3. (0.4, 0, 2.0, 0) results in (0, 0, 2, 0). (0.6, 0, 1.8, 0) results in (1, 0, 1, 0). Note: original width = 1.8, result width = 1; original right = 2.4, result right = 2. (0.6, 0, 2.0, 0) results in (1, 0, 2, 0).
Declaration
public static RadRect RoundByRespectingLocation(double rectX, double rectY, double rectWidth, double rectHeight)
Parameters
System.Double
rectX
|
System.Double
rectY
|
System.Double
rectWidth
|
System.Double
rectHeight
|
Returns
RadRect
|
Subtract(RadRect, RadRect)
Gets the difference between two RadRect structures.
Declaration
public static RadThickness Subtract(RadRect rect1, RadRect rect2)
Parameters
RadRect
rect1
|
RadRect
rect2
|
Returns
RadThickness
|
ToSquare(RadRect, Boolean)
Gets a rectangle that has equal width and height and is centered within the specified rect.
Declaration
public static RadRect ToSquare(RadRect rect, bool offset)
Parameters
RadRect
rect
|
System.Boolean
offset
|
Returns
RadRect
|
Operators
Equality(RadRect, RadRect)
Determines whether two RadRect structures are equal.
Declaration
public static bool operator ==(RadRect rect1, RadRect rect2)
Parameters
RadRect
rect1
|
RadRect
rect2
|
Returns
System.Boolean
|
Inequality(RadRect, RadRect)
Determines whether two RadRect structures are not equal.
Declaration
public static bool operator !=(RadRect rect1, RadRect rect2)
Parameters
RadRect
rect1
|
RadRect
rect2
|
Returns
System.Boolean
|