RectangleF Class
Summary: Stores a set of four floating-point numbers that represent the location and size of a rectangle.
Module: aspose.imaging
Full Name: aspose.imaging.RectangleF
Constructors
| Name | Description | 
|---|---|
| RectangleF() | Initializes a new instance of the RectangleF class | 
| RectangleF(location, size) | Initializes a new instance of the RectangleF structure with the specified location and size. | 
| RectangleF(x, y, width, height) | Initializes a new instance of the RectangleF structure with the specified location and size. | 
Properties
| Name | Type | Access | Description | 
|---|---|---|---|
| bottom | float | r/w | Gets or sets the y-coordinate that is the sum of RectangleF.y and RectangleF.height of this RectangleF structure. | 
| empty [static] | RectangleF | r | Gets a new instance of the RectangleF structure that has RectangleF.x, RectangleF.y, RectangleF.width and RectangleF.height values set to zero. | 
| height | float | r/w | Gets or sets the height of this RectangleF structure. | 
| is_empty | bool | r | Gets a value indicating whether the RectangleF.width or RectangleF.height property of this RectangleF has a value of zero. | 
| left | float | r/w | Gets or sets the x-coordinate of the left edge of this RectangleF structure. | 
| location | PointF | r/w | Gets or sets the coordinates of the upper-left corner of this RectangleF structure. | 
| right | float | r/w | Gets or sets the x-coordinate that is the sum of RectangleF.x and RectangleF.width of this RectangleF structure. | 
| size | SizeF | r/w | Gets or sets the size of this RectangleF. | 
| top | float | r/w | Gets or sets the y-coordinate of the top edge of this RectangleF structure. | 
| width | float | r/w | Gets or sets the width of this RectangleF structure. | 
| x | float | r/w | Gets or sets the x-coordinate of the upper-left corner of this RectangleF structure. | 
| y | float | r/w | Gets or sets the y-coordinate of the upper-left corner of this RectangleF structure. | 
Methods
| Name | Description | 
|---|---|
| contains(point) | Determines if the specified point is contained within this RectangleF structure. | 
| contains(rect) | Determines if the rectangular region represented by rect is entirely contained within this RectangleF structure. | 
| contains(x, y) | Determines if the specified point is contained within this RectangleF structure. | 
| contains_point_f(point) | Determines if the specified point is contained within this RectangleF structure. | 
| contains_rect_f(rect) | Determines if the rectangular region represented by rect is entirely contained within this RectangleF structure. | 
| from_left_top_right_bottom(left, top, right, bottom) | Creates a RectangleF structure with upper-left corner and lower-right corner at the specified locations. | 
| from_points(point1, point2) | Creates a new Rectangle from two points specified. Two verticles of the created Rectangle will be equal to the passed point1 and point2. These would be typically the opposite vertices. | 
| inflate(rect, x, y) | Creates and returns an inflated copy of the specified RectangleF structure. The copy is inflated by the specified amount. The original rectangle remains unmodified. | 
| inflate(size) | Inflates this RectangleF by the specified amount. | 
| inflate(x, y) | Inflates this RectangleF structure by the specified amount. | 
| inflate_rect(rect, x, y) | Creates and returns an inflated copy of the specified RectangleF structure. The copy is inflated by the specified amount. The original rectangle remains unmodified. | 
| intersect(a, b) | Returns a RectangleF structure that represents the intersection of two rectangles. If there is no intersection, and empty RectangleF is returned. | 
| intersect(rect) | Replaces this RectangleF structure with the intersection of itself and the specified RectangleF structure. | 
| intersect_rects(a, b) | Returns a RectangleF structure that represents the intersection of two rectangles. If there is no intersection, and empty RectangleF is returned. | 
| intersects_with(rect) | 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. | 
| offset(pos) | Adjusts the location of this rectangle by the specified amount. | 
| offset(x, y) | Adjusts the location of this rectangle by the specified amount. | 
| union(a, b) | Creates the smallest possible third rectangle that can contain both of two rectangles that form a union. | 
Constructor: RectangleF()
 RectangleF() 
Initializes a new instance of the RectangleF class
Constructor: RectangleF(location, size)
 RectangleF(location, size) 
Initializes a new instance of the RectangleF structure with the specified location and size.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| location | PointF | A PointF that represents the upper-left corner of the rectangular region. | 
| size | SizeF | A SizeF that represents the width and height of the rectangular region. | 
Constructor: RectangleF(x, y, width, height)
 RectangleF(x, y, width, height) 
Initializes a new instance of the RectangleF structure with the specified location and size.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| x | float | The x-coordinate of the upper-left corner of the rectangle. | 
| y | float | The y-coordinate of the upper-left corner of the rectangle. | 
| width | float | The width of the rectangle. | 
| height | float | The height of the rectangle. | 
Method: contains(point)
 contains(point) 
Determines if the specified point is contained within this RectangleF structure.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| point | PointF | The PointF to test. | 
Returns
| Type | Description | 
|---|---|
| bool | This method returns true if the point represented by the point parameter is contained within this RectangleF structure; otherwise false. | 
Method: contains(rect)
 contains(rect) 
Determines if the rectangular region represented by rect is entirely contained within this RectangleF structure.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| rect | RectangleF | The RectangleF to test. | 
Returns
| Type | Description | 
|---|---|
| bool | This method returns true if the rectangular region represented by rect is entirely contained within the rectangular region represented by this RectangleF; otherwise false. | 
Method: contains(x, y)
 contains(x, y) 
Determines if the specified point is contained within this RectangleF structure.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| x | float | The x-coordinate of the point to test. | 
| y | float | The y-coordinate of the point to test. | 
Returns
| Type | Description | 
|---|---|
| bool | This method returns true if the point defined by x and y is contained within this RectangleF structure; otherwise false. | 
Method: contains_point_f(point)
 contains_point_f(point) 
Determines if the specified point is contained within this RectangleF structure.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| point | PointF | The PointF to test. | 
Returns
| Type | Description | 
|---|---|
| bool | This method returns true if the point represented by the point parameter is contained within this RectangleF structure; otherwise false. | 
Method: contains_rect_f(rect)
 contains_rect_f(rect) 
Determines if the rectangular region represented by rect is entirely contained within this RectangleF structure.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| rect | RectangleF | The RectangleF to test. | 
Returns
| Type | Description | 
|---|---|
| bool | This method returns true if the rectangular region represented by rect is entirely contained within the rectangular region represented by this RectangleF; otherwise false. | 
Method: from_left_top_right_bottom(left, top, right, bottom) [static]
 from_left_top_right_bottom(left, top, right, bottom) 
Creates a RectangleF structure with upper-left corner and lower-right corner at the specified locations.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| left | float | The x-coordinate of the upper-left corner of the rectangular region. | 
| top | float | The y-coordinate of the upper-left corner of the rectangular region. | 
| right | float | The x-coordinate of the lower-right corner of the rectangular region. | 
| bottom | float | The y-coordinate of the lower-right corner of the rectangular region. | 
Returns
| Type | Description | 
|---|---|
| RectangleF | The new RectangleF that this method creates. | 
Method: from_points(point1, point2) [static]
 from_points(point1, point2) 
Creates a new Rectangle from two points specified. Two verticles of the created Rectangle will be equal to the passed point1 and point2. These would be typically the opposite vertices.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| point1 | PointF | The first Point for the new rectangle. | 
| point2 | PointF | The second Point for the new rectangle. | 
Returns
| Type | Description | 
|---|---|
| RectangleF | A newly created Rectangle. | 
Method: inflate(rect, x, y) [static]
 inflate(rect, x, y) 
Creates and returns an inflated copy of the specified RectangleF structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| rect | RectangleF | The RectangleF to be copied. This rectangle is not modified. | 
| x | float | The amount to inflate the copy of the rectangle horizontally. | 
| y | float | The amount to inflate the copy of the rectangle vertically. | 
Returns
| Type | Description | 
|---|---|
| RectangleF | The inflated RectangleF. | 
Method: inflate(size)
 inflate(size) 
Inflates this RectangleF by the specified amount.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| size | SizeF | The amount to inflate this rectangle. | 
Method: inflate(x, y)
 inflate(x, y) 
Inflates this RectangleF structure by the specified amount.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| x | float | The amount to inflate this RectangleF structure horizontally. | 
| y | float | The amount to inflate this RectangleF structure vertically. | 
Method: inflate_rect(rect, x, y) [static]
 inflate_rect(rect, x, y) 
Creates and returns an inflated copy of the specified RectangleF structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| rect | RectangleF | The RectangleF to be copied. This rectangle is not modified. | 
| x | float | The amount to inflate the copy of the rectangle horizontally. | 
| y | float | The amount to inflate the copy of the rectangle vertically. | 
Returns
| Type | Description | 
|---|---|
| RectangleF | The inflated RectangleF. | 
Method: intersect(a, b) [static]
 intersect(a, b) 
Returns a RectangleF structure that represents the intersection of two rectangles. If there is no intersection, and empty RectangleF is returned.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| a | RectangleF | A first rectangle to intersect. | 
| b | RectangleF | A second rectangle to intersect. | 
Returns
| Type | Description | 
|---|---|
| RectangleF | A third RectangleF structure the size of which represents the overlapped area of the two specified rectangles. | 
Method: intersect(rect)
 intersect(rect) 
Replaces this RectangleF structure with the intersection of itself and the specified RectangleF structure.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| rect | RectangleF | The rectangle to intersect. | 
Method: intersect_rects(a, b) [static]
 intersect_rects(a, b) 
Returns a RectangleF structure that represents the intersection of two rectangles. If there is no intersection, and empty RectangleF is returned.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| a | RectangleF | A first rectangle to intersect. | 
| b | RectangleF | A second rectangle to intersect. | 
Returns
| Type | Description | 
|---|---|
| RectangleF | A third RectangleF structure the size of which represents the overlapped area of the two specified rectangles. | 
Method: intersects_with(rect)
 intersects_with(rect) 
Determines if this rectangle intersects with rect.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| rect | RectangleF | The rectangle to test. | 
Returns
| Type | Description | 
|---|---|
| bool | This method returns true if there is any intersection. | 
Method: offset(pos)
 offset(pos) 
Adjusts the location of this rectangle by the specified amount.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| pos | PointF | The amount to offset the location. | 
Method: offset(x, y)
 offset(x, y) 
Adjusts the location of this rectangle by the specified amount.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| x | float | The amount to offset the location horizontally. | 
| y | float | The amount to offset the location vertically. | 
Method: union(a, b) [static]
 union(a, b) 
Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| a | RectangleF | A first rectangle to union. | 
| b | RectangleF | A second rectangle to union. | 
Returns
| Type | Description | 
|---|---|
| RectangleF | A third RectangleF structure that contains both of the two rectangles that form the union. |