RectangleF 类

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描述
RectangleF()初始化 RectangleF 类的新实例
RectangleF(location, size)使用指定的位置和大小初始化 RectangleF 结构的新实例。
RectangleF(x, y, width, height)使用指定的位置和大小初始化 RectangleF 结构的新实例。

Properties

NameTypeAccess描述
bottomfloatr/w获取或设置此 RectangleF 结构的 y 坐标,该坐标为 RectangleF.yRectangleF.height 的和。
empty [static]RectangleFr获取一个新的 RectangleF 结构实例,其 RectangleF.xRectangleF.yRectangleF.widthRectangleF.height 的值均为零。
heightfloatr/w获取或设置此 RectangleF 结构的高度。
is_emptyboolr获取一个值,指示此 RectangleFRectangleF.widthRectangleF.height 属性是否为零。
leftfloatr/w获取或设置此 RectangleF 结构左边缘的 x 坐标。
locationPointFr/w获取或设置此 RectangleF 结构左上角的坐标。
rightfloatr/w获取或设置此 RectangleF 结构的 x 坐标,该坐标为 RectangleF.xRectangleF.width 的和。
sizeSizeFr/w获取或设置此 RectangleF 的大小。
topfloatr/w获取或设置此 RectangleF 结构顶部边缘的 y 坐标。
widthfloatr/w获取或设置此 RectangleF 结构的宽度。
xfloatr/w获取或设置此 RectangleF 结构左上角的 x 坐标。
yfloatr/w获取或设置此 RectangleF 结构左上角的 y 坐标。

Methods

Name描述
contains(point)确定指定的点是否包含在此 RectangleF 结构中。
contains(rect)确定由 rect 表示的矩形区域是否完全包含在此 RectangleF 结构中。
contains(x, y)确定指定的点是否包含在此 RectangleF 结构中。
contains_point_f(point)确定指定的点是否包含在此 RectangleF 结构中。
contains_rect_f(rect)确定由 rect 表示的矩形区域是否完全包含在此 RectangleF 结构中。
from_left_top_right_bottom(left, top, right, bottom)创建一个 RectangleF 结构,其左上角和右下角位于指定位置。
from_points(point1, point2)从指定的两个点创建一个新的 Rectangle 。创建的 Rectangle 的两个顶点将等于传入的 point1point2。这些通常是相对的顶点。
inflate(rect, x, y)创建并返回指定的 RectangleF 结构的膨胀副本。该副本按指定量进行膨胀。原始矩形保持不变。
inflate(size)按指定量膨胀此 RectangleF
inflate(x, y)按指定量膨胀此 RectangleF 结构。
inflate_rect(rect, x, y)创建并返回指定的 RectangleF 结构的膨胀副本。该副本按指定量进行膨胀。原始矩形保持不变。
intersect(a, b)返回一个表示两个矩形交集的 RectangleF 结构。如果没有交集,则返回一个空的 RectangleF
intersect(rect)用自身与指定的 RectangleF 结构的交集替换此 RectangleF 结构。
intersect_rects(a, b)返回一个表示两个矩形交集的 RectangleF 结构。如果没有交集,则返回一个空的 RectangleF
intersects_with(rect)确定此矩形是否与 rect 相交。
normalize()通过使宽度和高度为正、左侧小于右侧、顶部小于底部来规范化矩形。
offset(pos)按指定量调整此矩形的位置。
offset(x, y)按指定量调整此矩形的位置。
union(a, b)创建能够包含两个矩形(形成并集)的最小可能的第三个矩形。

Constructor: RectangleF()

 RectangleF() 

初始化 RectangleF 类的新实例

Constructor: RectangleF(location, size)

 RectangleF(location, size) 

使用指定的位置和大小初始化 RectangleF 结构的新实例。

Parameters:

参数TypeDescription
locationPointF一个表示矩形区域左上角的 PointF
sizeSizeF一个表示矩形区域宽度和高度的 SizeF

Constructor: RectangleF(x, y, width, height)

 RectangleF(x, y, width, height) 

使用指定的位置和大小初始化 RectangleF 结构的新实例。

Parameters:

参数TypeDescription
xfloat矩形左上角的 x 坐标。
yfloat矩形左上角的 y 坐标。
widthfloat矩形的宽度。
heightfloat矩形的高度。

Method: contains(point)

 contains(point) 

确定指定的点是否包含在此 RectangleF 结构中。

Parameters:

参数TypeDescription
pointPointF要测试的 PointF

Returns

TypeDescription
bool如果 point 参数表示的点包含在此 RectangleF 结构中,则此方法返回 true;否则返回 false。

Method: contains(rect)

 contains(rect) 

确定由 rect 表示的矩形区域是否完全包含在此 RectangleF 结构中。

Parameters:

参数TypeDescription
rectRectangleF要测试的 RectangleF

Returns

TypeDescription
bool如果由 rect 表示的矩形区域完全包含在由此 RectangleF 表示的矩形区域中,则此方法返回 true;否则返回 false。

Method: contains(x, y)

 contains(x, y) 

确定指定的点是否包含在此 RectangleF 结构中。

Parameters:

参数TypeDescription
xfloat要测试的点的 x 坐标。
yfloat要测试的点的 y 坐标。

Returns

TypeDescription
bool如果由 xy 定义的点包含在此 RectangleF 结构中,则此方法返回 true;否则返回 false。

Method: contains_point_f(point)

 contains_point_f(point) 

确定指定的点是否包含在此 RectangleF 结构中。

Parameters:

参数TypeDescription
pointPointF要测试的 PointF

Returns

TypeDescription
bool如果 point 参数表示的点包含在此 RectangleF 结构中,则此方法返回 true;否则返回 false。

Method: contains_rect_f(rect)

 contains_rect_f(rect) 

确定由 rect 表示的矩形区域是否完全包含在此 RectangleF 结构中。

Parameters:

参数TypeDescription
rectRectangleF要测试的 RectangleF

Returns

TypeDescription
bool如果由 rect 表示的矩形区域完全包含在由此 RectangleF 表示的矩形区域中,则此方法返回 true;否则返回 false。

Method: from_left_top_right_bottom(left, top, right, bottom) [static]

 from_left_top_right_bottom(left, top, right, bottom) 

创建一个 RectangleF 结构,其左上角和右下角位于指定位置。

Parameters:

参数TypeDescription
float矩形区域左上角的 x 坐标。
float矩形区域左上角的 y 坐标。
float矩形区域右下角的 x 坐标。
float矩形区域右下角的 y 坐标。

Returns

TypeDescription
RectangleF此方法创建的新的 RectangleF

Method: from_points(point1, point2) [static]

 from_points(point1, point2) 

从指定的两个点创建一个新的 Rectangle 。创建的 Rectangle 的两个顶点将等于传入的 point1point2。这些通常是相对的顶点。

Parameters:

参数TypeDescription
point1PointF新矩形的第一个 Point
point2PointF新矩形的第二个 Point

Returns

TypeDescription
RectangleF新创建的 Rectangle

Method: inflate(rect, x, y) [static]

 inflate(rect, x, y) 

创建并返回指定的 RectangleF 结构的膨胀副本。该副本按指定量进行膨胀。原始矩形保持不变。

Parameters:

参数TypeDescription
rectRectangleF要复制的 RectangleF。此矩形不会被修改。
xfloat水平膨胀矩形副本的量。
yfloat垂直膨胀矩形副本的量。

Returns

TypeDescription
RectangleF膨胀后的 RectangleF

Method: inflate(size)

 inflate(size) 

按指定量膨胀此 RectangleF

Parameters:

参数TypeDescription
sizeSizeF膨胀此矩形的量。

Method: inflate(x, y)

 inflate(x, y) 

按指定量膨胀此 RectangleF 结构。

Parameters:

参数TypeDescription
xfloat水平膨胀此 RectangleF 结构的量。
yfloat垂直膨胀此 RectangleF 结构的量。

Method: inflate_rect(rect, x, y) [static]

 inflate_rect(rect, x, y) 

创建并返回指定的 RectangleF 结构的膨胀副本。该副本按指定量进行膨胀。原始矩形保持不变。

Parameters:

参数TypeDescription
rectRectangleF要复制的 RectangleF。此矩形不会被修改。
xfloat水平膨胀矩形副本的量。
yfloat垂直膨胀矩形副本的量。

Returns

TypeDescription
RectangleF膨胀后的 RectangleF

Method: intersect(a, b) [static]

 intersect(a, b) 

返回一个表示两个矩形交集的 RectangleF 结构。如果没有交集,则返回一个空的 RectangleF

Parameters:

参数TypeDescription
aRectangleF第一个要相交的矩形。
bRectangleF第二个要相交的矩形。

Returns

TypeDescription
RectangleF第三个 RectangleF 结构,其大小表示两个指定矩形的重叠区域。

Method: intersect(rect)

 intersect(rect) 

用自身与指定的 RectangleF 结构的交集替换此 RectangleF 结构。

Parameters:

参数TypeDescription
rectRectangleF要相交的矩形。

Method: intersect_rects(a, b) [static]

 intersect_rects(a, b) 

返回一个表示两个矩形交集的 RectangleF 结构。如果没有交集,则返回一个空的 RectangleF

Parameters:

参数TypeDescription
aRectangleF第一个要相交的矩形。
bRectangleF第二个要相交的矩形。

Returns

TypeDescription
RectangleF第三个 RectangleF 结构,其大小表示两个指定矩形的重叠区域。

Method: intersects_with(rect)

 intersects_with(rect) 

确定此矩形是否与 rect 相交。

Parameters:

参数TypeDescription
rectRectangleF要测试的矩形。

Returns

TypeDescription
bool如果存在任何交集,此方法返回 true。

Method: offset(pos)

 offset(pos) 

按指定量调整此矩形的位置。

Parameters:

参数TypeDescription
posPointF位置的偏移量。

Method: offset(x, y)

 offset(x, y) 

按指定量调整此矩形的位置。

Parameters:

参数TypeDescription
xfloat水平偏移位置的量。
yfloat垂直偏移位置的量。

Method: union(a, b) [static]

 union(a, b) 

创建能够包含两个矩形(形成并集)的最小可能的第三个矩形。

Parameters:

参数TypeDescription
aRectangleF第一个用于合并的矩形。
bRectangleF第二个用于合并的矩形。

Returns

TypeDescription
RectangleF第三个 RectangleF 结构,包含形成合并的两个矩形。