Rectangle class
Rectangle class
Stores a set of four integers that represent the location and size of a rectangle.
The Rectangle type exposes the following members:
Constructors
Constructor | Description |
---|---|
init | Initializes a new instance of the Rectangle structure with the specified location and size. |
init | Initializes a new instance of the Rectangle structure with the specified location and size. |
init | Constructs a new instance of Rectangle |
Properties
Property | Description |
---|---|
empty | Gets a new instance of the Rectangle structure that has Rectangle.x , Rectangle.y , Rectangle.width and Rectangle.height values set to zero. |
location | Gets or sets the coordinates of the upper-left corner of this Rectangle structure. |
size | Gets or sets the size of this Rectangle . |
x | Gets or sets the x-coordinate of the upper-left corner of this Rectangle structure. |
y | Gets or sets the y-coordinate of the upper-left corner of this Rectangle structure. |
width | Gets or sets the width of this Rectangle structure. |
height | Gets or sets the height of this Rectangle structure. |
left | Gets or sets the x-coordinate of the left edge of this Rectangle structure. |
top | Gets or sets the y-coordinate of the top edge of this Rectangle structure. |
right | Gets or sets the x-coordinate that is the sum of Rectangle.x and Rectangle.width property values of this Rectangle structure. |
bottom | Gets or sets the y-coordinate that is the sum of the Rectangle.y and Rectangle.height property values of this Rectangle structure. |
is_empty | Gets a value indicating whether all numeric properties of this Rectangle have values of zero. |
Methods
Method | Description |
---|---|
inflate | Creates and returns an inflated copy of the specified Rectangle structure. The copy is inflated by the specified amount. The original Rectangle structure remains unmodified. |
inflate | Inflates this Rectangle by the specified amount. |
inflate | Inflates this Rectangle by the specified amount. |
intersect | Returns a third Rectangle structure that represents the intersection of two other Rectangle structures. If there is no intersection, an empty Rectangle is returned. |
intersect | Replaces this Rectangle with the intersection of itself and the specified Rectangle . |
contains | Determines if the specified point is contained within this Rectangle structure. |
contains | Determines if the specified point is contained within this Rectangle structure. |
contains | Determines if the rectangular region represented by rect is entirely contained within this Rectangle structure. |
offset | Adjusts the location of this rectangle by the specified amount. |
offset | Adjusts the location of this rectangle by the specified amount. |
from_points | Creates a new Rectangle from two points specified. Two verticales of the created Rectangle will be equal to the passed point1 and point2 . These would be typically the opposite vertices. |
ceiling | Converts the specified RectangleF structure to a Rectangle structure by rounding the RectangleF values to the next higher integer values. |
truncate | Converts the specified RectangleF to a Rectangle by truncating the RectangleF values. |
round | Converts the specified RectangleF to a Rectangle by rounding the RectangleF values to the nearest integer values. |
union | Gets a Rectangle structure that contains the union of two Rectangle structures. |
from_left_top_right_bottom | Creates a Rectangle structure with the specified edge locations. |
intersects_with | Determines if this rectangle intersects with rect . |
normalize | Normalizes the rectangle by making it’s width and height positive, left less than right and top less than bottom. |
See Also
- module
aspose.cad
- class
Rectangle
- class
RectangleF