Struct Rect
Inherited Members
Namespace: Telerik.WinControls.Spreadsheet.UI
Assembly: Telerik.WinControls.RadSpreadsheet.dll
Syntax
public struct Rect : IFormattable
Constructors
Rect(Double, Double, Double, Double)
Initializes a new instance of the Rect class.
Declaration
public Rect(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. |
Rect(Point, Point)
Initializes a new instance of the Rect class.
Declaration
public Rect(Point point1, Point point2)
Parameters
Point
point1
The point1. |
Point
point2
The point2. |
Rect(Point, Size)
Initializes a new instance of the Rect class.
Declaration
public Rect(Point location, Size size)
Parameters
Point
location
The location. |
Size
size
The size. |
Rect(Point, Vector)
Initializes a new instance of the Rect class.
Declaration
public Rect(Point point, Vector vector)
Parameters
Point
point
The point. |
Vector
vector
The vector. |
Rect(Size)
Initializes a new instance of the Rect class.
Declaration
public Rect(Size size)
Parameters
Size
size
The size. |
Properties
Bottom
Declaration
public double Bottom { get; }
Property Value
System.Double
|
BottomLeft
BottomRight
Empty
Height
Declaration
public double Height { get; set; }
Property Value
System.Double
|
IsEmpty
Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean
|
Left
Declaration
public double Left { get; }
Property Value
System.Double
|
Location
Right
Declaration
public double Right { get; }
Property Value
System.Double
|
Size
Top
Gets the top.
Declaration
public double Top { get; }
Property Value
System.Double
The top. |
TopLeft
TopRight
Width
Gets or sets the width.
Declaration
public double Width { get; set; }
Property Value
System.Double
The width. |
X
Gets or sets the X coordinate.
Declaration
public double X { get; set; }
Property Value
System.Double
The X. |
Y
Gets or sets the Y coordinate.
Declaration
public double Y { get; set; }
Property Value
System.Double
The Y. |
Methods
Contains(Double, Double)
Indicates whether the rectangle contains the specified x-coordinate and y-coordinate.
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
true if (x, y) is contained by the rectangle; otherwise, false. |
Contains(Point)
Indicates whether the rectangle contains the specified point.
Declaration
public bool Contains(Point point)
Parameters
Point
point
The point to check. |
Returns
System.Boolean
true if the rectangle contains the specified point; otherwise, false. |
Contains(Rect)
Indicates whether the rectangle contains the specified rectangle.
Declaration
public bool Contains(Rect rect)
Parameters
Rect
rect
The rectangle to check. |
Returns
System.Boolean
true if rect is entirely contained by the rectangle; otherwise, false. |
Equals(Object)
Indicates whether the specified object is equal to the current rectangle.
Declaration
public override bool Equals(object o)
Parameters
System.Object
o
The object to compare to the current rectangle. |
Returns
System.Boolean
true if o is a Rect and has the same Location and Size values as the current rectangle; otherwise, false. |
Overrides
Equals(Rect)
Indicates whether the specified rectangle is equal to the current rectangle.
Declaration
public bool Equals(Rect value)
Parameters
Rect
value
The rectangle to compare to the current rectangle. |
Returns
System.Boolean
true if the specified rectangle has the same Location and Size values as the current rectangle; otherwise, false. |
Equals(Rect, Rect)
Indicates whether the specified rectangles are equal.
Declaration
public static bool Equals(Rect rect1, Rect rect2)
Parameters
Rect
rect1
The first rectangle to compare. |
Rect
rect2
The second rectangle to compare. |
Returns
System.Boolean
true if the rectangles have the same Location and Size values; otherwise, false. |
GetHashCode()
Creates a hash code for the rectangle.
Declaration
public override int GetHashCode()
Returns
System.Int32
A hash code for the current Rect structure. |
Overrides
Inflate(Double, Double)
Expands or shrinks the rectangle by using the specified width and height amounts, in all directions.
Declaration
public void Inflate(double width, double height)
Parameters
System.Double
width
The amount by which to expand or shrink the left and right sides of the rectangle. |
System.Double
height
The amount by which to expand or shrink the top and bottom sides of the rectangle. |
Inflate(Rect, Double, Double)
Creates a rectangle that results from expanding or shrinking the specified rectangle by the specified width and height amounts, in all directions.
Declaration
public static Rect Inflate(Rect rect, double width, double height)
Parameters
Rect
rect
The Rect structure to modify. |
System.Double
width
The amount by which to expand or shrink the left and right sides of the rectangle. |
System.Double
height
The amount by which to expand or shrink the top and bottom sides of the rectangle. |
Returns
Rect
The resulting rectangle. |
Inflate(Rect, Size)
Returns the rectangle that results from expanding the specified rectangle by the specified Size, in all directions.
Declaration
public static Rect Inflate(Rect rect, Size size)
Parameters
Rect
rect
The Rect structure to modify. |
Size
size
Specifies the amount to expand the rectangle. The Size structure's Width property specifies the amount to increase the rectangle's Left and Right properties. The Size structure's Height property specifies the amount to increase the rectangle's Top and Bottom properties. |
Returns
Rect
The resulting rectangle. |
Inflate(Size)
Expands the rectangle by using the specified Size, in all directions.
Declaration
public void Inflate(Size size)
Parameters
Size
size
Specifies the amount to expand the rectangle. The Size structure's Width property specifies the amount to increase the rectangle's Left and Right properties. The Size structure's Height property specifies the amount to increase the rectangle's Top and Bottom properties. |
Intersect(Rect)
Finds the intersection of the current rectangle and the specified rectangle, and stores the result as the current rectangle.
Declaration
public void Intersect(Rect rect)
Parameters
Rect
rect
The rectangle to intersect with the current rectangle. |
Intersect(Rect, Rect)
Returns the intersection of the specified rectangles.
Declaration
public static Rect Intersect(Rect rect1, Rect rect2)
Parameters
Rect
rect1
The first rectangle to compare. |
Rect
rect2
The second rectangle to compare. |
Returns
Rect
The intersection of the two rectangles, or Empty if no intersection exists. |
IntersectsWith(Rect)
Indicates whether the specified rectangle intersects with the current rectangle.
Declaration
public bool IntersectsWith(Rect rect)
Parameters
Rect
rect
The rectangle to check. |
Returns
System.Boolean
true if the specified rectangle intersects with the current rectangle; otherwise, false. |
Offset(Double, Double)
Moves the rectangle by the specified horizontal and vertical amounts.
Declaration
public void Offset(double offsetX, double offsetY)
Parameters
System.Double
offsetX
The amount to move the rectangle horizontally. |
System.Double
offsetY
The amount to move the rectangle vertically. |
Offset(Rect, Double, Double)
Returns a rectangle that is offset from the specified rectangle by using the specified horizontal and vertical amounts.
Declaration
public static Rect Offset(Rect rect, double offsetX, double offsetY)
Parameters
Rect
rect
The rectangle to move. |
System.Double
offsetX
The horizontal offset for the new rectangle. |
System.Double
offsetY
The vertical offset for the new rectangle. |
Returns
Rect
The resulting rectangle. |
Offset(Rect, Vector)
Returns a rectangle that is offset from the specified rectangle by using the specified vector.
Declaration
public static Rect Offset(Rect rect, Vector offsetVector)
Parameters
Rect
rect
The original rectangle. |
Vector
offsetVector
A vector that specifies the horizontal and vertical offsets for the new rectangle. |
Returns
Rect
The resulting rectangle. |
Offset(Vector)
Moves the rectangle by the specified vector.
Declaration
public void Offset(Vector offsetVector)
Parameters
Vector
offsetVector
A vector that specifies the horizontal and vertical amounts to move the rectangle. |
Parse(String)
Creates a new rectangle from the specified string representation.
Declaration
public static Rect Parse(string source)
Parameters
System.String
source
The string representation of the rectangle, in the form "x, y, width, height". |
Returns
Rect
The resulting rectangle. |
Scale(Double, Double)
Multiplies the size of the current rectangle by the specified x and y values.
Declaration
public void Scale(double scaleX, double scaleY)
Parameters
System.Double
scaleX
The scale factor in the x-direction. |
System.Double
scaleY
The scale factor in the y-direction. |
Union(Point)
Expands the current rectangle exactly enough to contain the specified point.
Declaration
public void Union(Point point)
Parameters
Point
point
The point to include. |
Union(Rect)
Expands the current rectangle exactly enough to contain the specified rectangle.
Declaration
public void Union(Rect rect)
Parameters
Rect
rect
The rectangle to include. |
Union(Rect, Point)
Creates a rectangle that is exactly large enough to include the specified rectangle and the specified point.
Declaration
public static Rect Union(Rect rect, Point point)
Parameters
Rect
rect
The rectangle to include. |
Point
point
The point to include. |
Returns
Rect
A rectangle that is exactly large enough to contain the specified rectangle and the specified point. |
Union(Rect, Rect)
Creates a rectangle that is exactly large enough to contain the two specified rectangles.
Declaration
public static Rect Union(Rect rect1, Rect rect2)
Parameters
Rect
rect1
The first rectangle to include. |
Rect
rect2
The second rectangle to include. |
Returns
Rect
The resulting rectangle. |
Operators
Equality(Rect, Rect)
Compares two rectangles for exact equality.
Declaration
public static bool operator ==(Rect rect1, Rect rect2)
Parameters
Rect
rect1
The first rectangle to compare. |
Rect
rect2
The second rectangle to compare. |
Returns
System.Boolean
true if the rectangles have the same Location and Size values; otherwise, false. |
Implicit(RectangleF to Rect)
Declaration
public static implicit operator Rect(RectangleF p)
Parameters
System.Drawing.RectangleF
p
|
Returns
Rect
|
Implicit(Rect to Rectangle)
Declaration
public static implicit operator Rectangle(Rect p)
Parameters
Rect
p
|
Returns
System.Drawing.Rectangle
|
Implicit(Rect to RectangleF)
Declaration
public static implicit operator RectangleF(Rect p)
Parameters
Rect
p
|
Returns
System.Drawing.RectangleF
|
Inequality(Rect, Rect)
Compares two rectangles for inequality.
Declaration
public static bool operator !=(Rect rect1, Rect rect2)
Parameters
Rect
rect1
The first rectangle to compare. |
Rect
rect2
The second rectangle to compare. |
Returns
System.Boolean
true if the rectangles do not have the same Location and Size values; otherwise, false. |
Explicit Interface Implementations
IFormattable.ToString(String, IFormatProvider)
Declaration
string IFormattable.ToString(string format, IFormatProvider provider)
Parameters
System.String
format
|
System.IFormatProvider
provider
|
Returns
System.String
|