public class RectangleF extends com.aspose.ms.lang.Struct<RectangleF>
Stores a set of four floating-point numbers that represent the location and size of a rectangle.
Constructor and Description |
---|
RectangleF() |
RectangleF(float x,
float y,
float width,
float height)
Initializes a new instance of the
RectangleF structure with the specified location and size. |
RectangleF(PointF location,
SizeF size)
Initializes a new instance of the
RectangleF structure with the specified location and size. |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
RectangleF |
Clone() |
void |
CloneTo(RectangleF that) |
boolean |
contains(float x,
float y)
Determines if the specified point is contained within this
RectangleF structure. |
boolean |
contains(PointF point)
Determines if the specified point is contained within this
RectangleF structure. |
boolean |
contains(RectangleF rect)
Determines if the rectangular region represented by
rect is entirely contained within this RectangleF structure. |
boolean |
equals(Object obj)
|
static RectangleF |
fromLeftTopRightBottom(float left,
float top,
float right,
float bottom)
Creates a
RectangleF structure with upper-left corner and lower-right corner at the specified locations. |
static RectangleF |
fromPoints(PointF point1,
PointF point2)
Creates a new
Rectangle from two points specified. |
float |
getBottom()
Gets or sets the y-coordinate that is the sum of
Aspose.PSD.RectangleF.Y (RectangleF.getY() /RectangleF.setY(float) ) and Aspose.PSD.RectangleF.Height (RectangleF.getHeight() /RectangleF.setHeight(float) ) of this RectangleF structure. |
static RectangleF |
getEmpty()
Gets a new instance of the
RectangleF structure that has Aspose.PSD.RectangleF.X (RectangleF.getX() /RectangleF.setX(float) ), Aspose.PSD.RectangleF.Y (RectangleF.getY() /RectangleF.setY(float) ), Aspose.PSD.RectangleF.Width (RectangleF.getWidth() /RectangleF.setWidth(float) ) and Aspose.PSD.RectangleF.Height (RectangleF.getHeight() /RectangleF.setHeight(float) ) values set to zero. |
float |
getHeight()
Gets or sets the height of this
RectangleF structure. |
float |
getLeft()
Gets or sets the x-coordinate of the left edge of this
RectangleF structure. |
PointF |
getLocation()
Gets or sets the coordinates of the upper-left corner of this
RectangleF structure. |
float |
getRight()
Gets or sets the x-coordinate that is the sum of
Aspose.PSD.RectangleF.X (RectangleF.getX() /RectangleF.setX(float) ) and Aspose.PSD.RectangleF.Width (RectangleF.getWidth() /RectangleF.setWidth(float) ) of this RectangleF structure. |
SizeF |
getSize()
Gets or sets the size of this
RectangleF . |
float |
getTop()
Gets or sets the y-coordinate of the top edge of this
RectangleF structure. |
float |
getWidth()
Gets or sets the width of this
RectangleF structure. |
float |
getX()
Gets or sets the x-coordinate of the upper-left corner of this
RectangleF structure. |
float |
getY()
Gets or sets the y-coordinate of the upper-left corner of this
RectangleF structure. |
int |
hashCode()
Gets the hash code for this
RectangleF structure. |
void |
inflate(float x,
float y)
Inflates this
RectangleF structure by the specified amount. |
static RectangleF |
inflate(RectangleF rect,
float x,
float y)
Creates and returns an inflated copy of the specified
RectangleF structure. |
void |
inflate(SizeF size)
Inflates this
RectangleF by the specified amount. |
void |
intersect(RectangleF rect)
Replaces this
RectangleF structure with the intersection of itself and the specified RectangleF structure. |
static RectangleF |
intersect(RectangleF a,
RectangleF b)
Returns a
RectangleF structure that represents the intersection of two rectangles. |
boolean |
intersectsWith(RectangleF rect)
Determines if this rectangle intersects with
rect . |
boolean |
isEmpty()
Gets a value indicating whether the
Aspose.PSD.RectangleF.Width (RectangleF.getWidth() /RectangleF.setWidth(float) ) or Aspose.PSD.RectangleF.Height (RectangleF.getHeight() /RectangleF.setHeight(float) ) property of this RectangleF has a value of zero. |
void |
normalize()
Normalizes the rectangle by making it's width and height positive, left less than right and top less than bottom.
|
void |
offset(float x,
float y)
Adjusts the location of this rectangle by the specified amount.
|
void |
offset(PointF pos)
Adjusts the location of this rectangle by the specified amount.
|
static boolean |
op_Equality(RectangleF left,
RectangleF right)
Tests whether two
RectangleF structures have equal location and size. |
static boolean |
op_Inequality(RectangleF left,
RectangleF right)
Tests whether two
RectangleF structures differ in location or size. |
void |
setBottom(float value)
Gets or sets the y-coordinate that is the sum of
Aspose.PSD.RectangleF.Y (RectangleF.getY() /RectangleF.setY(float) ) and Aspose.PSD.RectangleF.Height (RectangleF.getHeight() /RectangleF.setHeight(float) ) of this RectangleF structure. |
void |
setHeight(float value)
Gets or sets the height of this
RectangleF structure. |
void |
setLeft(float value)
Gets or sets the x-coordinate of the left edge of this
RectangleF structure. |
void |
setLocation(PointF value)
Gets or sets the coordinates of the upper-left corner of this
RectangleF structure. |
void |
setRight(float value)
Gets or sets the x-coordinate that is the sum of
Aspose.PSD.RectangleF.X (RectangleF.getX() /RectangleF.setX(float) ) and Aspose.PSD.RectangleF.Width (RectangleF.getWidth() /RectangleF.setWidth(float) ) of this RectangleF structure. |
void |
setSize(SizeF value)
Gets or sets the size of this
RectangleF . |
void |
setTop(float value)
Gets or sets the y-coordinate of the top edge of this
RectangleF structure. |
void |
setWidth(float value)
Gets or sets the width of this
RectangleF structure. |
void |
setX(float value)
Gets or sets the x-coordinate of the upper-left corner of this
RectangleF structure. |
void |
setY(float value)
Gets or sets the y-coordinate of the upper-left corner of this
RectangleF structure. |
static RectangleF |
to_RectangleF(Rectangle rect)
Converts the specified
Rectangle structure to a RectangleF structure. |
String |
toString()
Converts the attributes of this
RectangleF to a human-readable string. |
static RectangleF |
union(RectangleF a,
RectangleF b)
Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.
|
public RectangleF()
public RectangleF(float x, float y, float width, float height)
Initializes a new instance of the RectangleF
structure 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.public RectangleF(PointF location, SizeF size)
Initializes a new instance of the RectangleF
structure with the specified location and size.
public static RectangleF getEmpty()
Gets a new instance of the RectangleF
structure that has Aspose.PSD.RectangleF.X
(RectangleF.getX()
/RectangleF.setX(float)
), Aspose.PSD.RectangleF.Y
(RectangleF.getY()
/RectangleF.setY(float)
), Aspose.PSD.RectangleF.Width
(RectangleF.getWidth()
/RectangleF.setWidth(float)
) and Aspose.PSD.RectangleF.Height
(RectangleF.getHeight()
/RectangleF.setHeight(float)
) values set to zero.
public final PointF getLocation()
Gets or sets the coordinates of the upper-left corner of this RectangleF
structure.
PointF
that represents the upper-left corner of this RectangleF
structure.public final void setLocation(PointF value)
Gets or sets the coordinates of the upper-left corner of this RectangleF
structure.
value
- A PointF
that represents the upper-left corner of this RectangleF
structure.public final SizeF getSize()
Gets or sets the size of this RectangleF
.
SizeF
that represents the width and height of this RectangleF
structure.public final void setSize(SizeF value)
Gets or sets the size of this RectangleF
.
value
- A SizeF
that represents the width and height of this RectangleF
structure.public final float getX()
Gets or sets the x-coordinate of the upper-left corner of this RectangleF
structure.
RectangleF
structure.public final void setX(float value)
Gets or sets the x-coordinate of the upper-left corner of this RectangleF
structure.
value
- The x-coordinate of the upper-left corner of this RectangleF
structure.public final float getY()
Gets or sets the y-coordinate of the upper-left corner of this RectangleF
structure.
RectangleF
structure.public final void setY(float value)
Gets or sets the y-coordinate of the upper-left corner of this RectangleF
structure.
value
- The y-coordinate of the upper-left corner of this RectangleF
structure.public final float getWidth()
Gets or sets the width of this RectangleF
structure.
RectangleF
structure.public final void setWidth(float value)
Gets or sets the width of this RectangleF
structure.
value
- The width of this RectangleF
structure.public final float getHeight()
Gets or sets the height of this RectangleF
structure.
RectangleF
structure.public final void setHeight(float value)
Gets or sets the height of this RectangleF
structure.
value
- The height of this RectangleF
structure.public final float getLeft()
Gets or sets the x-coordinate of the left edge of this RectangleF
structure.
RectangleF
structure.public final void setLeft(float value)
Gets or sets the x-coordinate of the left edge of this RectangleF
structure.
value
- The x-coordinate of the left edge of this RectangleF
structure.public final float getTop()
Gets or sets the y-coordinate of the top edge of this RectangleF
structure.
RectangleF
structure.public final void setTop(float value)
Gets or sets the y-coordinate of the top edge of this RectangleF
structure.
value
- The y-coordinate of the top edge of this RectangleF
structure.public final float getRight()
Gets or sets the x-coordinate that is the sum of Aspose.PSD.RectangleF.X
(RectangleF.getX()
/RectangleF.setX(float)
) and Aspose.PSD.RectangleF.Width
(RectangleF.getWidth()
/RectangleF.setWidth(float)
) of this RectangleF
structure.
Aspose.PSD.RectangleF.X
(RectangleF.getX()
/RectangleF.setX(float)
) and Aspose.PSD.RectangleF.Width
(RectangleF.getWidth()
/RectangleF.setWidth(float)
) of this RectangleF
structure.public final void setRight(float value)
Gets or sets the x-coordinate that is the sum of Aspose.PSD.RectangleF.X
(RectangleF.getX()
/RectangleF.setX(float)
) and Aspose.PSD.RectangleF.Width
(RectangleF.getWidth()
/RectangleF.setWidth(float)
) of this RectangleF
structure.
value
- The x-coordinate that is the sum of Aspose.PSD.RectangleF.X
(RectangleF.getX()
/RectangleF.setX(float)
) and Aspose.PSD.RectangleF.Width
(RectangleF.getWidth()
/RectangleF.setWidth(float)
) of this RectangleF
structure.public final float getBottom()
Gets or sets the y-coordinate that is the sum of Aspose.PSD.RectangleF.Y
(RectangleF.getY()
/RectangleF.setY(float)
) and Aspose.PSD.RectangleF.Height
(RectangleF.getHeight()
/RectangleF.setHeight(float)
) of this RectangleF
structure.
Aspose.PSD.RectangleF.Y
(RectangleF.getY()
/RectangleF.setY(float)
) and Aspose.PSD.RectangleF.Height
(RectangleF.getHeight()
/RectangleF.setHeight(float)
) of this RectangleF
structure.public final void setBottom(float value)
Gets or sets the y-coordinate that is the sum of Aspose.PSD.RectangleF.Y
(RectangleF.getY()
/RectangleF.setY(float)
) and Aspose.PSD.RectangleF.Height
(RectangleF.getHeight()
/RectangleF.setHeight(float)
) of this RectangleF
structure.
value
- The y-coordinate that is the sum of Aspose.PSD.RectangleF.Y
(RectangleF.getY()
/RectangleF.setY(float)
) and Aspose.PSD.RectangleF.Height
(RectangleF.getHeight()
/RectangleF.setHeight(float)
) of this RectangleF
structure.public final boolean isEmpty()
Gets a value indicating whether the Aspose.PSD.RectangleF.Width
(RectangleF.getWidth()
/RectangleF.setWidth(float)
) or Aspose.PSD.RectangleF.Height
(RectangleF.getHeight()
/RectangleF.setHeight(float)
) property of this RectangleF
has a value of zero.
Aspose.PSD.RectangleF.Width
(RectangleF.getWidth()
/RectangleF.setWidth(float)
) or Aspose.PSD.RectangleF.Height
(RectangleF.getHeight()
/RectangleF.setHeight(float)
) property of this RectangleF
has a value of zero; otherwise, false.public static RectangleF fromPoints(PointF point1, PointF point2)
public static RectangleF inflate(RectangleF rect, float x, float 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.
rect
- The RectangleF
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.RectangleF
.public static RectangleF intersect(RectangleF a, RectangleF b)
Returns a RectangleF
structure that represents the intersection of two rectangles. If there is no intersection, and empty RectangleF
is returned.
a
- A first rectangle to intersect.b
- A second rectangle to intersect.RectangleF
structure the size of which represents the overlapped area of the two specified rectangles.public static RectangleF union(RectangleF a, RectangleF b)
Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.
a
- A first rectangle to union.b
- A second rectangle to union.RectangleF
structure that contains both of the two rectangles that form the union.public static boolean op_Equality(RectangleF left, RectangleF right)
Tests whether two RectangleF
structures have equal location and size.
left
- The RectangleF
structure that is to the left of the equality operator.right
- The RectangleF
structure that is to the right of the equality operator.RectangleF
structures have equal Aspose.PSD.RectangleF.X
(RectangleF.getX()
/RectangleF.setX(float)
), Aspose.PSD.RectangleF.Y
(RectangleF.getY()
/RectangleF.setY(float)
), Aspose.PSD.RectangleF.Width
(RectangleF.getWidth()
/RectangleF.setWidth(float)
), and Aspose.PSD.RectangleF.Height
(RectangleF.getHeight()
/RectangleF.setHeight(float)
) properties.public static boolean op_Inequality(RectangleF left, RectangleF right)
Tests whether two RectangleF
structures differ in location or size.
left
- The RectangleF
structure that is to the left of the inequality operator.right
- The RectangleF
structure that is to the right of the inequality operator.Aspose.PSD.RectangleF.X
(RectangleF.getX()
/RectangleF.setX(float)
) , Aspose.PSD.RectangleF.Y
(RectangleF.getY()
/RectangleF.setY(float)
), Aspose.PSD.RectangleF.Width
(RectangleF.getWidth()
/RectangleF.setWidth(float)
), or Aspose.PSD.RectangleF.Height
(RectangleF.getHeight()
/RectangleF.setHeight(float)
) properties of the two RectangleF
structures are unequal; otherwise false.public static RectangleF to_RectangleF(Rectangle rect)
Converts the specified Rectangle
structure to a RectangleF
structure.
rect
- The Rectangle
structure to convert.RectangleF
structure that is converted from the specified Rectangle
structure.public static RectangleF fromLeftTopRightBottom(float left, float top, float right, float bottom)
Creates a RectangleF
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.RectangleF
that this method creates.public final void normalize()
Normalizes the rectangle by making it's width and height positive, left less than right and top less than bottom.
public final boolean contains(float x, float y)
Determines if the specified point is contained within this RectangleF
structure.
x
- The x-coordinate of the point to test.y
- The y-coordinate of the point to test.x
and y
is contained within this RectangleF
structure; otherwise false.public final boolean contains(PointF point)
Determines if the specified point is contained within this RectangleF
structure.
point
- The PointF
to test.point
parameter is contained within this RectangleF
structure; otherwise false.public final boolean contains(RectangleF rect)
Determines if the rectangular region represented by rect
is entirely contained within this RectangleF
structure.
rect
- The RectangleF
to test.rect
is entirely contained within the rectangular region represented by this RectangleF
; otherwise false.public final void inflate(float x, float y)
Inflates this RectangleF
structure by the specified amount.
x
- The amount to inflate this RectangleF
structure horizontally.y
- The amount to inflate this RectangleF
structure vertically.public final void inflate(SizeF size)
Inflates this RectangleF
by the specified amount.
size
- The amount to inflate this rectangle.public final void intersect(RectangleF rect)
Replaces this RectangleF
structure with the intersection of itself and the specified RectangleF
structure.
rect
- The rectangle to intersect.public final boolean intersectsWith(RectangleF rect)
Determines if this rectangle intersects with rect
.
rect
- The rectangle to test.public final void offset(PointF pos)
Adjusts the location of this rectangle by the specified amount.
pos
- The amount to offset the location.public final void offset(float x, float y)
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.public boolean equals(Object obj)
Tests whether obj
is a RectangleF
with the same location and size of this RectangleF
.
equals
in class Object
obj
- The Object
to test.obj
is a RectangleF
and its X, Y, Width, and Height properties are equal to the corresponding properties of this RectangleF
; otherwise, false.public int hashCode()
Gets the hash code for this RectangleF
structure.
hashCode
in class Object
RectangleF
.public String toString()
Converts the attributes of this RectangleF
to a human-readable string.
toString
in class Object
RectangleF
structure.public void CloneTo(RectangleF that)
CloneTo
in class com.aspose.ms.System.ValueType<RectangleF>
public RectangleF Clone()
Clone
in class com.aspose.ms.System.ValueType<RectangleF>
Copyright (c) 2008-2020 Aspose Pty Ltd. All Rights Reserved.