Struct
RadRect

Represents a Rectangle in the Euclidean plane geometry.

Definition

Namespace:Telerik.Charting

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
public struct RadRect

Inherited Members ValueType.ToString()

Constructors

RadRect(RadPoint, RadPoint)

Initializes a new instance of the RadRect struct.

Declaration

cs-api-definition
public RadRect(RadPoint point1, RadPoint point2)

Parameters

point1

RadPoint

The first point defining the rectangle bounds.

point2

RadPoint

The second point defining the rectangle bounds.

RadRect(double, double)

Initializes a new instance of the RadRect struct.

Declaration

cs-api-definition
public RadRect(double width, double height)

Parameters

width

double

The width of the rectangle.

height

double

The height of the rectangle.

RadRect(double, double, double, double)

Initializes a new instance of the RadRect struct.

Declaration

cs-api-definition
public RadRect(double x, double y, double width, double height)

Parameters

x

double

The X-coordinate of the rectangle.

y

double

The Y-coordinate of the rectangle.

width

double

The width of the rectangle.

height

double

The height of the rectangle.

Fields

Empty

Empty rectangle which values are zeroes.

Declaration

cs-api-definition
public static readonly RadRect Empty

Field Value

RadRect

Height

The length of the rectangle along the Y-axis.

Declaration

cs-api-definition
public double Height

Field Value

double

Invalid

Invalid rectangle, which Width and Height properties are set to (-1).

Declaration

cs-api-definition
public static readonly RadRect Invalid

Field Value

RadRect

Width

The length of the rectangle along the X-axis.

Declaration

cs-api-definition
public double Width

Field Value

double

X

The X-coordinate of the rectangle.

Declaration

cs-api-definition
public double X

Field Value

double

Y

The Y-coordinate of the rectangle.

Declaration

cs-api-definition
public double Y

Field Value

double

Properties

Bottom

Gets the Y-coordinate of the bottom side of the rectangle.

Declaration

cs-api-definition
public double Bottom { get; }

Property Value

double

Center

Gets the center of this rectangle.

Declaration

cs-api-definition
public RadPoint Center { get; }

Property Value

RadPoint

Location

Gets the location (Top-Left corner) of the rectangle.

Declaration

cs-api-definition
public RadPoint Location { get; }

Property Value

RadPoint

Right

Gets the X-coordinate of the right side of the rectangle.

Declaration

cs-api-definition
public double Right { get; }

Property Value

double

Methods

CenterRect(RadRect, RadRect)

Centers the specified rectangle within the provided available one.

Declaration

cs-api-definition
public static RadRect CenterRect(RadRect rect, RadRect bounds)

Parameters

rect

RadRect

bounds

RadRect

Returns

RadRect

Contains(double, double)

Determines if this RadRect instance contains the point that is described by the arguments.

Declaration

cs-api-definition
public bool Contains(double x, double y)

Parameters

x

double

The X coordinate of the point to check.

y

double

The Y coordinate of the point to check.

Returns

bool

Returns true if this rectangle contains the point from the arguments and false otherwise.

Equals(object)

Determines whether the specified object is equal to this instance.

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

The object to compare with this instance.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

Overrides ValueType.Equals(object)

Floor(RadRect)

Rounds the rectangle's value to the closest less than or equal to whole numbers.

Declaration

cs-api-definition
public static RadRect Floor(RadRect rect)

Parameters

rect

RadRect

Returns

RadRect

GetHashCode()

Returns a hash code for this instance.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Overrides ValueType.GetHashCode()

IntersectsWith(RadRect)

Determines whether the current rect intersects with the specified one.

Declaration

cs-api-definition
public bool IntersectsWith(RadRect rect)

Parameters

rect

RadRect

Returns

bool

IsSizeValid()

Determines whether the size of this rect is valid - that is both Width and Height should be bigger than zero.

Declaration

cs-api-definition
public bool IsSizeValid()

Returns

bool

Round(RadRect)

Rounds the rectangle's values by respecting the Width and Height.

Declaration

cs-api-definition
public static RadRect Round(RadRect rect)

Parameters

rect

RadRect

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

cs-api-definition
public static RadRect RoundByRespectingLocation(double rectX, double rectY, double rectWidth, double rectHeight)

Parameters

rectX

double

rectY

double

rectWidth

double

rectHeight

double

Returns

RadRect

Subtract(RadRect, RadRect)

Gets the difference between two RadRect structures.

Declaration

cs-api-definition
public static RadThickness Subtract(RadRect rect1, RadRect rect2)

Parameters

rect1

RadRect

rect2

RadRect

Returns

RadThickness

ToSquare(RadRect, bool)

Gets a rectangle that has equal width and height and is centered within the specified rect.

Declaration

cs-api-definition
public static RadRect ToSquare(RadRect rect, bool offset)

Parameters

rect

RadRect

offset

bool

Returns

RadRect

Operators

operator !=(RadRect, RadRect)

Determines whether two RadRect structures are not equal.

Declaration

cs-api-definition
public static bool operator !=(RadRect rect1, RadRect rect2)

Parameters

rect1

RadRect

rect2

RadRect

Returns

bool

operator ==(RadRect, RadRect)

Determines whether two RadRect structures are equal.

Declaration

cs-api-definition
public static bool operator ==(RadRect rect1, RadRect rect2)

Parameters

rect1

RadRect

rect2

RadRect

Returns

bool