Struct RRect
Stores a set of four floating-point numbers that represent the location and size of a rectangle.
Inherited Members
Namespace: TheArtOfDev.HtmlRenderer.Adapters.Entities
Assembly: Telerik.WinControls.RadMap.dll
Syntax
public struct RRect
Constructors
RRect(Double, Double, Double, Double)
Initializes a new instance of the RRect class with the specified location and size.
Declaration
public RRect(double x, double y, double width, double height)
Parameters
System.Double
x
The x-coordinate of the upper-left corner of the rectangle. |
System.Double
y
The y-coordinate of the upper-left corner of the rectangle. |
System.Double
width
The width of the rectangle. |
System.Double
height
The height of the rectangle. |
RRect(RPoint, RSize)
Initializes a new instance of the RRect class with the specified location and size.
Declaration
public RRect(RPoint location, RSize size)
Parameters
RPoint
location
A RPoint that represents the upper-left corner of the rectangular region. |
RSize
size
A RSize that represents the width and height of the rectangular region. |
Fields
Empty
Represents an instance of the RRect class with its members uninitialized.
Declaration
public static readonly RRect Empty
Field Value
RRect
|
Properties
Bottom
Declaration
public double Bottom { get; }
Property Value
System.Double
The y-coordinate that is the sum of Y and Height of this RRect structure. |
Height
Gets or sets the height of this RRect structure.
Declaration
public double Height { get; set; }
Property Value
System.Double
The height of this RRect structure. |
IsEmpty
Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean
This property returns true if the Width or Height property of this RRect has a value of zero; otherwise, false. |
Left
Gets the x-coordinate of the left edge of this RRect structure.
Declaration
public double Left { get; }
Property Value
System.Double
The x-coordinate of the left edge of this RRect structure. |
Location
Gets or sets the coordinates of the upper-left corner of this RRect structure.
Declaration
public RPoint Location { get; set; }
Property Value
RPoint
A RPoint that represents the upper-left corner of this RRect structure. |
Right
Declaration
public double Right { get; }
Property Value
System.Double
The x-coordinate that is the sum of X and Width of this RRect structure. |
Size
Gets or sets the size of this RRect.
Declaration
public RSize Size { get; set; }
Property Value
RSize
A RSize that represents the width and height of this RRect structure. |
Top
Gets the y-coordinate of the top edge of this RRect structure.
Declaration
public double Top { get; }
Property Value
System.Double
The y-coordinate of the top edge of this RRect structure. |
Width
Gets or sets the width of this RRect structure.
Declaration
public double Width { get; set; }
Property Value
System.Double
The width of this RRect structure. |
X
Gets or sets the x-coordinate of the upper-left corner of this RRect structure.
Declaration
public double X { get; set; }
Property Value
System.Double
The x-coordinate of the upper-left corner of this RRect structure. |
Y
Gets or sets the y-coordinate of the upper-left corner of this RRect structure.
Declaration
public double Y { get; set; }
Property Value
System.Double
The y-coordinate of the upper-left corner of this RRect structure. |
Methods
Contains(Double, Double)
Determines if the specified point is contained within this RRect structure.
Declaration
public bool Contains(double x, double y)
Parameters
System.Double
x
The x-coordinate of the point to test. |
System.Double
y
The y-coordinate of the point to test. |
Returns
System.Boolean
This method returns true if the point defined by |
Contains(RPoint)
Determines if the specified point is contained within this RRect structure.
Declaration
public bool Contains(RPoint pt)
Parameters
RPoint
pt
The RPoint to test. |
Returns
System.Boolean
This method returns true if the point represented by the |
Contains(RRect)
Determines if the rectangular region represented by rect
is entirely contained within this
RRect
structure.
Declaration
public bool Contains(RRect rect)
Parameters
RRect
rect
The RRect to test. |
Returns
System.Boolean
This method returns true if the rectangular region represented by |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
The System.Object to test. |
Returns
System.Boolean
This method returns true if |
Overrides
FromLTRB(Double, Double, Double, Double)
Creates a RRect structure with upper-left corner and lower-right corner at the specified locations.
Declaration
public static RRect FromLTRB(double left, double top, double right, double bottom)
Parameters
System.Double
left
The x-coordinate of the upper-left corner of the rectangular region. |
System.Double
top
The y-coordinate of the upper-left corner of the rectangular region. |
System.Double
right
The x-coordinate of the lower-right corner of the rectangular region. |
System.Double
bottom
The y-coordinate of the lower-right corner of the rectangular region. |
Returns
RRect
The new RRect that this method creates. |
GetHashCode()
Gets the hash code for this RRect structure. For information about the use of hash codes, see Object.GetHashCode.
Declaration
public override int GetHashCode()
Returns
System.Int32
The hash code for this RRect |
Overrides
Inflate(Double, Double)
Inflates this RRect structure by the specified amount.
Declaration
public void Inflate(double x, double y)
Parameters
System.Double
x
The amount to inflate this RRect structure horizontally. |
System.Double
y
The amount to inflate this RRect structure vertically. |
Inflate(RRect, Double, Double)
Creates and returns an inflated copy of the specified RRect structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.
Declaration
public static RRect Inflate(RRect rect, double x, double y)
Parameters
RRect
rect
The RRect to be copied. This rectangle is not modified. |
System.Double
x
The amount to inflate the copy of the rectangle horizontally. |
System.Double
y
The amount to inflate the copy of the rectangle vertically. |
Returns
RRect
The inflated RRect. |
Inflate(RSize)
Inflates this RRect by the specified amount.
Declaration
public void Inflate(RSize size)
Parameters
RSize
size
The amount to inflate this rectangle. |
Intersect(RRect)
Intersect(RRect, RRect)
Returns a RRect structure that represents the intersection of two rectangles. If there is no intersection, and empty RRect is returned.
Declaration
public static RRect Intersect(RRect a, RRect b)
Parameters
RRect
a
A rectangle to intersect. |
RRect
b
A rectangle to intersect. |
Returns
RRect
A third RRect structure the size of which represents the overlapped area of the two specified rectangles. |
IntersectsWith(RRect)
Determines if this rectangle intersects with rect
.
Declaration
public bool IntersectsWith(RRect rect)
Parameters
RRect
rect
The rectangle to test. |
Returns
System.Boolean
This method returns true if there is any intersection. |
Offset(Double, Double)
Adjusts the location of this rectangle by the specified amount.
Declaration
public void Offset(double x, double y)
Parameters
System.Double
x
The amount to offset the location horizontally. |
System.Double
y
The amount to offset the location vertically. |
Offset(RPoint)
Adjusts the location of this rectangle by the specified amount.
Declaration
public void Offset(RPoint pos)
Parameters
RPoint
pos
The amount to offset the location. |
ToString()
Converts the Location and Size of this RRect to a human-readable string.
Declaration
public override string ToString()
Returns
System.String
A string that contains the position, width, and height of this RRect structure for example, "{X=20, Y=20, Width=100, Height=50}". |
Overrides
Union(RRect, RRect)
Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.
Declaration
public static RRect Union(RRect a, RRect b)
Parameters
RRect
a
A rectangle to union. |
RRect
b
A rectangle to union. |
Returns
RRect
A third RRect structure that contains both of the two rectangles that form the union. |
Operators
Equality(RRect, RRect)
Tests whether two RRect structures have equal location and size.
Declaration
public static bool operator ==(RRect left, RRect right)
Parameters
RRect
left
The RRect structure that is to the left of the equality operator. |
RRect
right
The RRect structure that is to the right of the equality operator. |
Returns
System.Boolean
This operator returns true if the two specified RRect structures have equal X, Y, Width, and Height properties. |
Inequality(RRect, RRect)
Tests whether two RRect structures differ in location or size.
Declaration
public static bool operator !=(RRect left, RRect right)
Parameters
RRect
left
The RRect structure that is to the left of the inequality operator. |
RRect
right
The RRect structure that is to the right of the inequality operator. |
Returns
System.Boolean
This operator returns true if any of the X , Y, Width, or Height properties of the two RRect structures are unequal; otherwise false. |