New to Telerik ReportingStart a free 30-day trial

Stores a set of four Unit-based numbers that represent the location and size of a rectangle.

Definition

Namespace:Telerik.Reporting.Drawing

Assembly:Telerik.Reporting.dll

Syntax:

C#
public struct RectangleU

Constructors

Initializes a new instance of the RectangleU class with the specified location and size.

C#
public RectangleU(PointU location, SizeU size)
Parameters:locationPointU

A PointU that represents the upper-left corner of the rectangular region.

sizeSizeU

A SizeU that represents the width and height of the rectangular region.

Initializes a new instance of the RectangleU class from the specified Rectangle in device-independent pixels.

C#
public RectangleU(Rectangle rectangleDips)
Parameters:rectangleDipsRectangle

A Rectangle that represents the rectangular region.

Initializes a new instance of the RectangleU class from the specified RectangleF in device-independent pixels.

C#
public RectangleU(RectangleF rectangleDips)
Parameters:rectangleDipsRectangleF

A RectangleF that represents the rectangular region.

Initializes a new instance of the RectangleU class with the specified location and size.

C#
public RectangleU(Unit x, Unit y, Unit width, Unit height)
Parameters:xUnit

The x-coordinate of the upper-left corner of the rectangle.

yUnit

The y-coordinate of the upper-left corner of the rectangle.

widthUnit

The width of the rectangle.

heightUnit

The height of the rectangle.

Fields

Represents an instance of the RectangleU class with its members uninitialized.

C#
public static readonly RectangleU Empty
Remarks:

The members of the new RectangleU are left uninitialized.

Properties

Gets the y-coordinate that is the sum of Y and Height of this RectangleU structure.

C#
[Browsable(false)]
public Unit Bottom { get; }
Property Value:

The y-coordinate that is the sum of Y and Height of this RectangleU structure.

Gets or sets the height of this RectangleU structure.

C#
public Unit Height { get; set; }
Property Value:

The height of this RectangleF structure.

Tests whether the X, Y, Width, and Height properties of this RectangleU have a value of zero.

C#
[Browsable(false)]
public bool IsEmpty { get; }
Property Value:

This property returns true if the X, Y, Width, and Height properties of this RectangleU have a value of zero; otherwise, false.

Gets the x-coordinate of the left edge of this RectangleU structure.

C#
[Browsable(false)]
public Unit Left { get; }
Property Value:

The x-coordinate of the left edge of this RectangleU structure.

Gets or sets the coordinates of the upper-left corner of this RectangleU structure.

C#
[Browsable(false)]
public PointU Location { get; set; }
Property Value:

A PointU that represents the upper-left corner of this RectangleF structure.

Gets the x-coordinate that is the sum of X and Width of this RectangleU structure.

C#
[Browsable(false)]
public Unit Right { get; }
Property Value:

The x-coordinate that is the sum of X and Width of this RectangleU structure.

Gets or sets the size of this RectangleU.

C#
[Browsable(false)]
public SizeU Size { get; set; }
Property Value:

A SizeU that represents the width and height of this RectangleU structure.

Gets the y-coordinate of the left edge of this RectangleU structure.

C#
[Browsable(false)]
public Unit Top { get; }
Property Value:

The y-coordinate of the left edge of this RectangleU structure.

Gets or sets the width of this RectangleU structure.

C#
public Unit Width { get; set; }
Property Value:

The width of this RectangleF structure.

Gets or sets the x-coordinate of the upper-left corner of this RectangleU structure.

C#
public Unit X { get; set; }
Property Value:

The x-coordinate of the upper-left corner of this RectangleF structure.

Gets or sets the y-coordinate of the upper-left corner of this RectangleU structure.

C#
public Unit Y { get; set; }
Property Value:

The y-coordinate of the upper-left corner of this RectangleF structure.

Methods

Determines if the specified point is contained within this RectangleU structure.

C#
public bool Contains(PointU pt)
Parameters:ptPointU

The PointU to test.

Returns:

bool

This method returns true if the point represented by the pt parameter is contained within this RectangleU structure; otherwise false.

Determines if the rectangular region represented by rect is entirely contained within this RectangleU structure.

C#
public bool Contains(RectangleU rect)
Parameters:rectRectangleU

The RectangleF to test.

Returns:

bool

This method returns true if the rectangular region represented by rect is entirely contained within the rectangular region represented by this RectangleU; otherwise false.

Determines if the specified point is contained within this RectangleU structure.

C#
public bool Contains(Unit x, Unit y)
Parameters:xUnit

The x-coordinate of the point to test.

yUnit

The x-coordinate of the point to test.

Returns:

bool

This method returns true if the point defined by x and y is contained within this RectangleU structure; otherwise false.

Tests whether obj is a RectangleU with the same location and size of this RectangleU.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to test.

Returns:

bool

This method returns true if obj is a RectangleU and its X, Y, Width, and Height properties are equal to the corresponding properties of this RectangleU; otherwise, false.

Overrides: ValueType.Equals(object)

Returns a hash code for this RectangleU structure.

C#
public override int GetHashCode()
Returns:

int

An integer value that specifies a hash value for this RectangleU structure.

Overrides: ValueType.GetHashCode()

Inflates rect by the specified amount.

C#
public static RectangleU Inflate(RectangleU rect, Unit x, Unit y)
Parameters:rectRectangleU

The RectangleU structure to inflate.

xUnit

The amount to inflate this RectangleU structure horizontally.

yUnit

The amount to inflate this RectangleU structure vertically.

Returns:

RectangleU

The inflated RectangleU structure.

Inflates this RectangleU structure by the specified amount.

C#
public void Inflate(SizeU size)
Parameters:sizeSizeU

The amount to inflate this rectangle.

Inflates this RectangleU structure by the specified amount.

C#
public void Inflate(Unit width, Unit height)
Parameters:widthUnit

The amount to inflate this RectangleU structure horizontally.

heightUnit

The amount to inflate this RectangleU structure vertically.

Determines if this rectangle intersects with rect.

C#
public bool IntersectsWith(RectangleU rect)
Parameters:rectRectangleU

The rectangle to test.

Returns:

bool

This method returns true if there is any intersection; otherwise false.

Adjusts the location of this rectangle by the specified amount.

C#
public void Offset(PointU pos)
Parameters:posPointU

The amount to offset the location.

Adjusts the location of this rectangle by the specified amount.

C#
public void Offset(Unit x, Unit y)
Parameters:xUnit

The amount to offset the location horizontally.

yUnit

The amount to offset the location vertically.

Converts the Location and Size of this RectangleU to a human-readable string.

C#
public override string ToString()
Returns:

string

A human-readable representation of the rectangle.

Overrides: ValueType.ToString()

Converts the Location and Size of this RectangleU to a human-readable string.

C#
public string ToString(CultureInfo culture)
Parameters:cultureCultureInfo

A CultureInfo object according to which to format the string.

Returns:

string

A human-readable representation of the rectangle.

Operators

Converts the specified RectangleU structure to a Rectangle structure in device-dependent pixels.

C#
public static explicit operator Rectangle(RectangleU rect)
Parameters:rectRectangleU

The RectangleU structure to convert.

Returns:

Rectangle

The Rectangle structure that is converted from the specified RectangleU structure.

Converts the specified RectangleU structure to a RectangleF structure in device-dependent pixels.

C#
public static explicit operator RectangleF(RectangleU rect)
Parameters:rectRectangleU

The RectangleU structure to convert.

Returns:

RectangleF

The RectangleF structure that is converted from the specified RectangleU structure.

Tests whether two RectangleU structures differ in location or size.

C#
public static bool operator !=(RectangleU rect1, RectangleU rect2)
Parameters:rect1RectangleU

The RectangleU structure that is to the left of the equality operator.

rect2RectangleU

The RectangleU structure that is to the right of the equality operator.

Returns:

bool

This operator returns true if any of the X, Y, Width, or Height properties of the two RectangleU structures are unequal; otherwise false.

Tests whether two RectangleU structures have equal location and size.

C#
public static bool operator ==(RectangleU rect1, RectangleU rect2)
Parameters:rect1RectangleU

The RectangleU structure that is to the left of the equality operator.

rect2RectangleU

The RectangleU structure that is to the right of the equality operator.

Returns:

bool

This operator returns true if the two specified RectangleU structures have equal X, Y, Width, and Height properties.