Struct
RadRect

Represents a Rectangle in the Euclidean plane geometry.

Definition

Namespace:Telerik.Charting

Assembly:Telerik.Windows.Controls.Chart.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 point1.

point2

RadPoint

The point2.

RadRect(RadPoint, RadSize)

Initializes a new instance of the RadRect struct.

Declaration

cs-api-definition
public RadRect(RadPoint location, RadSize size)

Parameters

location

RadPoint

The location of the Top-Left corner.

size

RadSize

The size of the RadRect struct.

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.

height

double

The height.

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 Top-Left corner.

y

double

The Y coordinate of the Top-Left corner.

width

double

The width.

height

double

The height.

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

IsEmpty

Gets indicating if the RadRect is empty.

Declaration

cs-api-definition
public bool IsEmpty { get; }

Property Value

bool

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

Size

Gets the size the RadRect.

Declaration

cs-api-definition
public RadSize Size { get; }

Property Value

RadSize

The size.

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

The RadRect that should be moved to the new location.

bounds

RadRect

The RadRect that specifies the available bounds.

Returns

RadRect

A new instance of RadRect with width and height as the given RadRect and placed in the center of the provided region.

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

The RadRect that will be rounded.

Returns

RadRect

A new instance of RadRect with rounded values.

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()

Inflate(RadRect, RadThickness)

Returns the rectangle that results from expanding or shrinking the specified rectangle with the specified margins.

Declaration

cs-api-definition
public static RadRect Inflate(RadRect rect, RadThickness margins)

Parameters

rect

RadRect

The RadRect structure to modify.

margins

RadThickness

The margins.

Returns

RadRect

A new instance of RadRect with modified dimensions.

Intersect(RadRect)

Finds the intersection of the current rectangle and the specified rectangle, and stores the result as the current rectangle.

Declaration

cs-api-definition
public void Intersect(RadRect rect)

Parameters

rect

RadRect

The rectangle to intersect with the current rectangle.

IntersectsWith(RadRect)

Determines whether the current RadRect 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 RadRect 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.

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

The first RadRect.

rect2

RadRect

The second RadRect.

Returns

RadThickness

A RadThickness instance, that represents the difference between the two RadRect instances.

ToSquare(RadRect, bool)

Gets a RadRect that has equal width and height and fits within the specified RadRect.

Declaration

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

Parameters

rect

RadRect

The RadRect.

offset

bool

Specifies whether the resulting RadRect should keep the original Top-Left location or it should be centered within the original RadRect.

Returns

RadRect

A new instance of RadRect with equal width and height, that fits within the provided bounds.

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

The first RadRect.

rect2

RadRect

The second RadRect.

Returns

bool

true if the values of the operands are not equal, otherwise false.

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

The first RadRect.

rect2

RadRect

The second RadRect.

Returns

bool

true if the values of the operands are equal, otherwise false.