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
com.aspose.psd.RectangleF structure with the specified location and size. |
RectangleF(PointF location,
SizeF size)
Initializes a new instance of the
com.aspose.psd.RectangleF structure with the specified location and size. |
Modifier and Type | Method and Description |
---|---|
RectangleF |
Clone() |
void |
CloneTo(RectangleF that) |
boolean |
contains(float x,
float y)
Determines if the specified point is contained within this
com.aspose.psd.RectangleF structure. |
boolean |
contains(PointF point)
Determines if the specified point is contained within this
com.aspose.psd.RectangleF structure. |
boolean |
contains(RectangleF rect)
Determines if the rectangular region represented by
rect is entirely contained within this com.aspose.psd.RectangleF structure. |
boolean |
equals(Object obj)
Tests whether
obj is a com.aspose.psd.RectangleF with the same location and size of this com.aspose.psd.RectangleF . |
static RectangleF |
fromLeftTopRightBottom(float left,
float top,
float right,
float bottom)
Creates a
com.aspose.psd.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
com.aspose.psd.RectangleF.Y and com.aspose.psd.RectangleF.Height of this com.aspose.psd.RectangleF structure. |
static RectangleF |
getEmpty()
Gets a new instance of the
com.aspose.psd.RectangleF structure that has com.aspose.psd.RectangleF.X , com.aspose.psd.RectangleF.Y , com.aspose.psd.RectangleF.Width and com.aspose.psd.RectangleF.Height values set to zero. |
float |
getHeight()
Gets or sets the height of this
com.aspose.psd.RectangleF structure. |
float |
getLeft()
Gets or sets the x-coordinate of the left edge of this
com.aspose.psd.RectangleF structure. |
PointF |
getLocation()
Gets or sets the coordinates of the upper-left corner of this
com.aspose.psd.RectangleF structure. |
float |
getRight()
Gets or sets the x-coordinate that is the sum of
com.aspose.psd.RectangleF.X and com.aspose.psd.RectangleF.Width of this com.aspose.psd.RectangleF structure. |
SizeF |
getSize()
Gets or sets the size of this
com.aspose.psd.RectangleF . |
float |
getTop()
Gets or sets the y-coordinate of the top edge of this
com.aspose.psd.RectangleF structure. |
float |
getWidth()
Gets or sets the width of this
com.aspose.psd.RectangleF structure. |
float |
getX()
Gets or sets the x-coordinate of the upper-left corner of this
com.aspose.psd.RectangleF structure. |
float |
getY()
Gets or sets the y-coordinate of the upper-left corner of this
com.aspose.psd.RectangleF structure. |
int |
hashCode()
Gets the hash code for this
com.aspose.psd.RectangleF structure. |
void |
inflate(float x,
float y)
Inflates this
com.aspose.psd.RectangleF structure by the specified amount. |
static RectangleF |
inflate(RectangleF rect,
float x,
float y)
Creates and returns an inflated copy of the specified
com.aspose.psd.RectangleF structure. |
void |
inflate(SizeF size)
Inflates this
com.aspose.psd.RectangleF by the specified amount. |
void |
intersect(RectangleF rect)
Replaces this
com.aspose.psd.RectangleF structure with the intersection of itself and the specified com.aspose.psd.RectangleF structure. |
static RectangleF |
intersect(RectangleF a,
RectangleF b)
Returns a
com.aspose.psd.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
com.aspose.psd.RectangleF.Width or com.aspose.psd.RectangleF.Height property of this com.aspose.psd.RectangleF has a value of zero. |
static boolean |
isEquals(RectangleF obj1,
RectangleF obj2) |
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 RectangleF |
op_Division(RectangleF rectangle,
float divider)
Implements the operator /.
|
static boolean |
op_Equality(RectangleF left,
RectangleF right)
Tests whether two
com.aspose.psd.RectangleF structures have equal location and size. |
static boolean |
op_Inequality(RectangleF left,
RectangleF right)
Tests whether two
com.aspose.psd.RectangleF structures differ in location or size. |
static RectangleF |
op_Multiply(RectangleF rectangle,
float multiplier)
Implements the operator *.
|
void |
setBottom(float value)
Gets or sets the y-coordinate that is the sum of
com.aspose.psd.RectangleF.Y and com.aspose.psd.RectangleF.Height of this com.aspose.psd.RectangleF structure. |
void |
setHeight(float value)
Gets or sets the height of this
com.aspose.psd.RectangleF structure. |
void |
setLeft(float value)
Gets or sets the x-coordinate of the left edge of this
com.aspose.psd.RectangleF structure. |
void |
setLocation(PointF value)
Gets or sets the coordinates of the upper-left corner of this
com.aspose.psd.RectangleF structure. |
void |
setRight(float value)
Gets or sets the x-coordinate that is the sum of
com.aspose.psd.RectangleF.X and com.aspose.psd.RectangleF.Width of this com.aspose.psd.RectangleF structure. |
void |
setSize(SizeF value)
Gets or sets the size of this
com.aspose.psd.RectangleF . |
void |
setTop(float value)
Gets or sets the y-coordinate of the top edge of this
com.aspose.psd.RectangleF structure. |
void |
setWidth(float value)
Gets or sets the width of this
com.aspose.psd.RectangleF structure. |
void |
setX(float value)
Gets or sets the x-coordinate of the upper-left corner of this
com.aspose.psd.RectangleF structure. |
void |
setY(float value)
Gets or sets the y-coordinate of the upper-left corner of this
com.aspose.psd.RectangleF structure. |
static RectangleF |
to_RectangleF(Rectangle rect)
Converts the specified
com.aspose.psd.Rectangle structure to a com.aspose.psd.RectangleF structure. |
String |
toString()
Converts the attributes of this
com.aspose.psd.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 com.aspose.psd.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 com.aspose.psd.RectangleF
structure with the specified location and size.
location
- A com.aspose.psd.PointF
that represents the upper-left corner of the rectangular region.size
- A com.aspose.psd.SizeF
that represents the width and height of the rectangular region.public static RectangleF getEmpty()
Gets a new instance of the com.aspose.psd.RectangleF
structure that has com.aspose.psd.RectangleF.X
, com.aspose.psd.RectangleF.Y
, com.aspose.psd.RectangleF.Width
and com.aspose.psd.RectangleF.Height
values set to zero.
public PointF getLocation()
Gets or sets the coordinates of the upper-left corner of this com.aspose.psd.RectangleF
structure.
com.aspose.psd.PointF
that represents the upper-left corner of this com.aspose.psd.RectangleF
structure.public void setLocation(PointF value)
Gets or sets the coordinates of the upper-left corner of this com.aspose.psd.RectangleF
structure.
public SizeF getSize()
Gets or sets the size of this com.aspose.psd.RectangleF
.
com.aspose.psd.SizeF
that represents the width and height of this com.aspose.psd.RectangleF
structure.public void setSize(SizeF value)
Gets or sets the size of this com.aspose.psd.RectangleF
.
public float getX()
Gets or sets the x-coordinate of the upper-left corner of this com.aspose.psd.RectangleF
structure.
com.aspose.psd.RectangleF
structure.public void setX(float value)
Gets or sets the x-coordinate of the upper-left corner of this com.aspose.psd.RectangleF
structure.
public float getY()
Gets or sets the y-coordinate of the upper-left corner of this com.aspose.psd.RectangleF
structure.
com.aspose.psd.RectangleF
structure.public void setY(float value)
Gets or sets the y-coordinate of the upper-left corner of this com.aspose.psd.RectangleF
structure.
public float getWidth()
Gets or sets the width of this com.aspose.psd.RectangleF
structure.
com.aspose.psd.RectangleF
structure.public void setWidth(float value)
Gets or sets the width of this com.aspose.psd.RectangleF
structure.
public float getHeight()
Gets or sets the height of this com.aspose.psd.RectangleF
structure.
com.aspose.psd.RectangleF
structure.public void setHeight(float value)
Gets or sets the height of this com.aspose.psd.RectangleF
structure.
public float getLeft()
Gets or sets the x-coordinate of the left edge of this com.aspose.psd.RectangleF
structure.
com.aspose.psd.RectangleF
structure.public void setLeft(float value)
Gets or sets the x-coordinate of the left edge of this com.aspose.psd.RectangleF
structure.
public float getTop()
Gets or sets the y-coordinate of the top edge of this com.aspose.psd.RectangleF
structure.
com.aspose.psd.RectangleF
structure.public void setTop(float value)
Gets or sets the y-coordinate of the top edge of this com.aspose.psd.RectangleF
structure.
public float getRight()
Gets or sets the x-coordinate that is the sum of com.aspose.psd.RectangleF.X
and com.aspose.psd.RectangleF.Width
of this com.aspose.psd.RectangleF
structure.
com.aspose.psd.RectangleF.X
and com.aspose.psd.RectangleF.Width
of this com.aspose.psd.RectangleF
structure.public void setRight(float value)
Gets or sets the x-coordinate that is the sum of com.aspose.psd.RectangleF.X
and com.aspose.psd.RectangleF.Width
of this com.aspose.psd.RectangleF
structure.
public float getBottom()
Gets or sets the y-coordinate that is the sum of com.aspose.psd.RectangleF.Y
and com.aspose.psd.RectangleF.Height
of this com.aspose.psd.RectangleF
structure.
com.aspose.psd.RectangleF.Y
and com.aspose.psd.RectangleF.Height
of this com.aspose.psd.RectangleF
structure.public void setBottom(float value)
Gets or sets the y-coordinate that is the sum of com.aspose.psd.RectangleF.Y
and com.aspose.psd.RectangleF.Height
of this com.aspose.psd.RectangleF
structure.
public boolean isEmpty()
Gets a value indicating whether the com.aspose.psd.RectangleF.Width
or com.aspose.psd.RectangleF.Height
property of this com.aspose.psd.RectangleF
has a value of zero.
com.aspose.psd.RectangleF.Width
or com.aspose.psd.RectangleF.Height
property of this com.aspose.psd.RectangleF
has a value of zero; otherwise, false.public static RectangleF fromPoints(PointF point1, PointF 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.
point1
- The first Point
for the new rectangle.point2
- The second Point
for the new rectangle.Rectangle
.public static RectangleF inflate(RectangleF rect, float x, float y)
Creates and returns an inflated copy of the specified com.aspose.psd.RectangleF
structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.
rect
- The com.aspose.psd.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.com.aspose.psd.RectangleF
.public static RectangleF intersect(RectangleF a, RectangleF b)
Returns a com.aspose.psd.RectangleF
structure that represents the intersection of two rectangles. If there is no intersection, and empty com.aspose.psd.RectangleF
is returned.
a
- A first rectangle to intersect.b
- A second rectangle to intersect.com.aspose.psd.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.com.aspose.psd.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 com.aspose.psd.RectangleF
structures have equal location and size.
left
- The com.aspose.psd.RectangleF
structure that is to the left of the equality operator.right
- The com.aspose.psd.RectangleF
structure that is to the right of the equality operator.com.aspose.psd.RectangleF
structures have equal com.aspose.psd.RectangleF.X
, com.aspose.psd.RectangleF.Y
, com.aspose.psd.RectangleF.Width
, and com.aspose.psd.RectangleF.Height
properties.public static boolean op_Inequality(RectangleF left, RectangleF right)
Tests whether two com.aspose.psd.RectangleF
structures differ in location or size.
left
- The com.aspose.psd.RectangleF
structure that is to the left of the inequality operator.right
- The com.aspose.psd.RectangleF
structure that is to the right of the inequality operator.com.aspose.psd.RectangleF.X
, com.aspose.psd.RectangleF.Y
, com.aspose.psd.RectangleF.Width
, or com.aspose.psd.RectangleF.Height
properties of the two com.aspose.psd.RectangleF
structures are unequal; otherwise false.public static RectangleF op_Multiply(RectangleF rectangle, float multiplier)
Implements the operator *.
rectangle
- The rectangle.multiplier
- The multiplier.public static RectangleF op_Division(RectangleF rectangle, float divider)
Implements the operator /.
rectangle
- The rectangle.divider
- The divider.com.aspose.ms.System.ArgumentOutOfRangeException
- divider - Division by zero is not allowed.public static RectangleF to_RectangleF(Rectangle rect)
Converts the specified com.aspose.psd.Rectangle
structure to a com.aspose.psd.RectangleF
structure.
rect
- The com.aspose.psd.Rectangle
structure to convert.com.aspose.psd.RectangleF
structure that is converted from the specified com.aspose.psd.Rectangle
structure.public static RectangleF fromLeftTopRightBottom(float left, float top, float right, float bottom)
Creates a com.aspose.psd.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.com.aspose.psd.RectangleF
that this method creates.public void normalize()
Normalizes the rectangle by making it's width and height positive, left less than right and top less than bottom.
public boolean contains(float x, float y)
Determines if the specified point is contained within this com.aspose.psd.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 com.aspose.psd.RectangleF
structure; otherwise false.public boolean contains(PointF point)
Determines if the specified point is contained within this com.aspose.psd.RectangleF
structure.
point
- The com.aspose.psd.PointF
to test.point
parameter is contained within this com.aspose.psd.RectangleF
structure; otherwise false.public boolean contains(RectangleF rect)
Determines if the rectangular region represented by rect
is entirely contained within this com.aspose.psd.RectangleF
structure.
rect
- The com.aspose.psd.RectangleF
to test.rect
is entirely contained within the rectangular region represented by this com.aspose.psd.RectangleF
; otherwise false.public void inflate(float x, float y)
Inflates this com.aspose.psd.RectangleF
structure by the specified amount.
x
- The amount to inflate this com.aspose.psd.RectangleF
structure horizontally.y
- The amount to inflate this com.aspose.psd.RectangleF
structure vertically.public void inflate(SizeF size)
Inflates this com.aspose.psd.RectangleF
by the specified amount.
size
- The amount to inflate this rectangle.public void intersect(RectangleF rect)
Replaces this com.aspose.psd.RectangleF
structure with the intersection of itself and the specified com.aspose.psd.RectangleF
structure.
rect
- The rectangle to intersect.public boolean intersectsWith(RectangleF rect)
Determines if this rectangle intersects with rect
.
rect
- The rectangle to test.public void offset(PointF pos)
Adjusts the location of this rectangle by the specified amount.
pos
- The amount to offset the location.public 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 com.aspose.psd.RectangleF
with the same location and size of this com.aspose.psd.RectangleF
.
public int hashCode()
Gets the hash code for this com.aspose.psd.RectangleF
structure.
public String toString()
Converts the attributes of this com.aspose.psd.RectangleF
to a human-readable string.
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>
public static boolean isEquals(RectangleF obj1, RectangleF obj2)