RRect

TheArtOfDev.HtmlRenderer.Adapters.Entities

Stores a set of four floating-point numbers that represent the location and size of a rectangle.

Constructors

RRect(RPoint, RSize)

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

location
A RPoint that represents the upper-left corner of the rectangular region.
size
A RSize that represents the width and height of the rectangular region.
RRect(double, double, double, double)

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

x
The x-coordinate of the upper-left corner of the rectangle.
y
The y-coordinate of the upper-left corner of the rectangle.
width
The width of the rectangle.
height
The height of the rectangle.

Properties

Bottom : double

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

Returns: The y-coordinate that is the sum of Y and Height of this RRect structure.

Height : double

Gets or sets the height of this RRect structure.

Returns: The height of this RRect structure.

IsEmpty : bool

Tests whether the Width or Height property of this RRect has a value of zero.

Returns: This property returns true if the Width or Height property of this RRect has a value of zero; otherwise, false.

Left : double

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

Returns: The x-coordinate of the left edge of this RRect structure.

Location : RPoint

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

Returns: A RPoint that represents the upper-left corner of this RRect structure.

Right : double

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

Returns: The x-coordinate that is the sum of X and Width of this RRect structure.

Size : RSize

Gets or sets the size of this RRect.

Returns: A RSize that represents the width and height of this RRect structure.

Top : double

Gets the y-coordinate of the top edge of this RRect structure.

Returns: The y-coordinate of the top edge of this RRect structure.

Width : double

Gets or sets the width of this RRect structure.

Returns: The width of this RRect structure.

X : double

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

Returns: The x-coordinate of the upper-left corner of this RRect structure.

Y : double

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

Returns: The y-coordinate of the upper-left corner of this RRect structure.

Methods

Contains(RRect) : bool

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

rect
The RRect to test.

Returns: This method returns true if the rectangular region represented by is entirely contained within the rectangular region represented by this RRect ; otherwise false.

Contains(double, double) : bool

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

x
The x-coordinate of the point to test.
y
The y-coordinate of the point to test.

Returns: This method returns true if the point defined by and is contained within this RRect structure; otherwise false.

Contains(RPoint) : bool

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

pt
The RPoint to test.

Returns: This method returns true if the point represented by the parameter is contained within this RRect structure; otherwise false.

Equals(object) : bool

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

obj
The Object to test.

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

FromLTRB(double, double, double, double) : RRect

Creates a RRect structure with upper-left corner and lower-right corner at the specified locations.

left
The x-coordinate of the upper-left corner of the rectangular region.
top
The y-coordinate of the upper-left corner of the rectangular region.
right
The x-coordinate of the lower-right corner of the rectangular region.
bottom
The y-coordinate of the lower-right corner of the rectangular region.

Returns: The new RRect that this method creates.

GetHashCode() : int

Gets the hash code for this RRect structure. For information about the use of hash codes, see Object.GetHashCode.

Returns: The hash code for this RRect

Inflate(RRect, double, double) : RRect

Creates and returns an inflated copy of the specified RRect structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.

rect
The RRect to be copied. This rectangle is not modified.
x
The amount to inflate the copy of the rectangle horizontally.
y
The amount to inflate the copy of the rectangle vertically.

Returns: The inflated RRect.

Inflate(double, double)

Inflates this RRect structure by the specified amount.

x
The amount to inflate this RRect structure horizontally.
y
The amount to inflate this RRect structure vertically.
Inflate(RSize)

Inflates this RRect by the specified amount.

size
The amount to inflate this rectangle.
Intersect(RRect, RRect) : RRect

Returns a RRect structure that represents the intersection of two rectangles. If there is no intersection, and empty RRect is returned.

a
A rectangle to intersect.
b
A rectangle to intersect.

Returns: A third RRect structure the size of which represents the overlapped area of the two specified rectangles.

Intersect(RRect)

Replaces this RRect structure with the intersection of itself and the specified RRect structure.

rect
The rectangle to intersect.
IntersectsWith(RRect) : bool

Determines if this rectangle intersects with .

rect
The rectangle to test.

Returns: This method returns true if there is any intersection.

Offset(RPoint)

Adjusts the location of this rectangle by the specified amount.

pos
The amount to offset the location.
Offset(double, double)

Adjusts the location of this rectangle by the specified amount.

x
The amount to offset the location horizontally.
y
The amount to offset the location vertically.
op_Equality(RRect, RRect) : bool

Tests whether two RRect structures have equal location and size.

left
The RRect structure that is to the left of the equality operator.
right
The RRect structure that is to the right of the equality operator.

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

op_Inequality(RRect, RRect) : bool

Tests whether two RRect structures differ in location or size.

left
The RRect structure that is to the left of the inequality operator.
right
The RRect structure that is to the right of the inequality operator.

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

ToString() : string

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

Returns: A string that contains the position, width, and height of this RRect structure for example, "{X=20, Y=20, Width=100, Height=50}".

Union(RRect, RRect) : RRect

Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.

a
A rectangle to union.
b
A rectangle to union.

Returns: A third RRect structure that contains both of the two rectangles that form the union.

Fields

Empty : RRect

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