PointF
Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.lang.Struct
public final class PointF extends Struct<PointF>
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimensional plane.
Constructors
| Constructor | Description |
|---|---|
| PointF() | |
| PointF(float x, float y) | Initializes a new instance of the com.aspose.imaging.PointF structure with the specified coordinates. |
Methods
| Method | Description |
|---|---|
| getEmpty() | Gets a new instance of the com.aspose.imaging.PointF structure that has com.aspose.imaging.PointF.X and com.aspose.imaging.PointF.Y values set to zero. |
| op_Addition(PointF point, Size size) | Translates a com.aspose.imaging.PointF by a given com.aspose.imaging.Size. |
| op_Subtraction(PointF point, Size size) | Translates a com.aspose.imaging.PointF by the negative of a given com.aspose.imaging.Size. |
| op_Addition(PointF point, SizeF size) | Translates the com.aspose.imaging.PointF by the specified com.aspose.imaging.SizeF. |
| op_Subtraction(PointF point, SizeF size) | Translates a com.aspose.imaging.PointF by the negative of a specified com.aspose.imaging.SizeF. |
| op_Equality(PointF point1, PointF point2) | Compares two com.aspose.imaging.PointF structures. |
| op_Inequality(PointF point1, PointF point2) | Determines whether the coordinates of the specified points are not equal. |
| add(PointF point, Size size) | Translates a given com.aspose.imaging.PointF by the specified com.aspose.imaging.Size. |
| subtract(PointF point, Size size) | Translates a com.aspose.imaging.PointF by the negative of a specified size. |
| add(PointF point, SizeF size) | Translates a given com.aspose.imaging.PointF by a specified com.aspose.imaging.SizeF. |
| subtract(PointF point, SizeF size) | Translates a com.aspose.imaging.PointF by the negative of a specified size. |
| isEquals(PointF obj1, PointF obj2) | |
| isEmpty() | Gets a value indicating whether this com.aspose.imaging.PointF is empty. |
| getX() | Gets or sets the x-coordinate of this com.aspose.imaging.PointF. |
| setX(float value) | Gets or sets the x-coordinate of this com.aspose.imaging.PointF. |
| getY() | Gets or sets the y-coordinate of this com.aspose.imaging.PointF. |
| setY(float value) | Gets or sets the y-coordinate of this com.aspose.imaging.PointF. |
| equals(Object obj) | Specifies whether this com.aspose.imaging.PointF contains the same coordinates as the specified System.Object. |
| hashCode() | Returns a hash code for this com.aspose.imaging.PointF structure. |
| toString() | Converts this com.aspose.imaging.PointF to a human readable string. |
| CloneTo(PointF that) | |
| Clone() |
PointF()
public PointF()
PointF(float x, float y)
public PointF(float x, float y)
Initializes a new instance of the com.aspose.imaging.PointF structure with the specified coordinates.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| x | float | The horizontal position of the point. |
| y | float | The vertical position of the point. |
getEmpty()
public static PointF getEmpty()
Gets a new instance of the com.aspose.imaging.PointF structure that has com.aspose.imaging.PointF.X and com.aspose.imaging.PointF.Y values set to zero.
Returns: PointF
op_Addition(PointF point, Size size)
public static PointF op_Addition(PointF point, Size size)
Translates a com.aspose.imaging.PointF by a given com.aspose.imaging.Size.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | PointF | The com.aspose.imaging.PointF to translate. |
| size | Size | A com.aspose.imaging.Size that specifies the pair of numbers to add to the coordinates of point. |
Returns:
PointF - Returns the translated com.aspose.imaging.PointF.
op_Subtraction(PointF point, Size size)
public static PointF op_Subtraction(PointF point, Size size)
Translates a com.aspose.imaging.PointF by the negative of a given com.aspose.imaging.Size.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | PointF | A com.aspose.imaging.PointF to translate. |
| size | Size | A com.aspose.imaging.Size that specifies the numbers to subtract from the x- and y-coordinates of the point. |
Returns:
PointF - The translated com.aspose.imaging.PointF.
op_Addition(PointF point, SizeF size)
public static PointF op_Addition(PointF point, SizeF size)
Translates the com.aspose.imaging.PointF by the specified com.aspose.imaging.SizeF.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | PointF | The com.aspose.imaging.PointF to translate. |
| size | SizeF | The com.aspose.imaging.SizeF that specifies the numbers to add to the x- and y-coordinates of the point. |
Returns:
PointF - The translated com.aspose.imaging.PointF.
op_Subtraction(PointF point, SizeF size)
public static PointF op_Subtraction(PointF point, SizeF size)
Translates a com.aspose.imaging.PointF by the negative of a specified com.aspose.imaging.SizeF.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | PointF | The com.aspose.imaging.PointF to translate. |
| size | SizeF | The com.aspose.imaging.SizeF that specifies the numbers to subtract from the coordinates of point. |
Returns:
PointF - The translated com.aspose.imaging.PointF.
op_Equality(PointF point1, PointF point2)
public static boolean op_Equality(PointF point1, PointF point2)
Compares two com.aspose.imaging.PointF structures. The result specifies whether the values of the com.aspose.imaging.PointF.X and com.aspose.imaging.PointF.Y properties of the two com.aspose.imaging.PointF structures are equal.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point1 | PointF | A first com.aspose.imaging.PointF to compare. |
| point2 | PointF | A second com.aspose.imaging.PointF to compare. |
Returns:
boolean - True if the com.aspose.imaging.PointF.X and com.aspose.imaging.PointF.Y values of the first and second com.aspose.imaging.PointF structures are equal; otherwise, false.
op_Inequality(PointF point1, PointF point2)
public static boolean op_Inequality(PointF point1, PointF point2)
Determines whether the coordinates of the specified points are not equal.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point1 | PointF | A first com.aspose.imaging.PointF to compare. |
| point2 | PointF | A second com.aspose.imaging.PointF to compare. |
Returns:
boolean - True to indicate the com.aspose.imaging.PointF.X and com.aspose.imaging.PointF.Y values of point1 and point2 are not equal; otherwise, false.
add(PointF point, Size size)
public static PointF add(PointF point, Size size)
Translates a given com.aspose.imaging.PointF by the specified com.aspose.imaging.Size.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | PointF | The com.aspose.imaging.PointF to translate. |
| size | Size | The com.aspose.imaging.Size that specifies the numbers to add to the coordinates of point. |
Returns:
PointF - The translated com.aspose.imaging.PointF.
subtract(PointF point, Size size)
public static PointF subtract(PointF point, Size size)
Translates a com.aspose.imaging.PointF by the negative of a specified size.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | PointF | The com.aspose.imaging.PointF to translate. |
| size | Size | The com.aspose.imaging.Size that specifies the numbers to subtract from the coordinates of point. |
Returns:
PointF - The translated com.aspose.imaging.PointF.
add(PointF point, SizeF size)
public static PointF add(PointF point, SizeF size)
Translates a given com.aspose.imaging.PointF by a specified com.aspose.imaging.SizeF.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | PointF | The com.aspose.imaging.PointF to translate. |
| size | SizeF | The com.aspose.imaging.SizeF that specifies the numbers to add to the coordinates of point. |
Returns:
PointF - The translated com.aspose.imaging.PointF.
subtract(PointF point, SizeF size)
public static PointF subtract(PointF point, SizeF size)
Translates a com.aspose.imaging.PointF by the negative of a specified size.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | PointF | The com.aspose.imaging.PointF to translate. |
| size | SizeF | The com.aspose.imaging.SizeF that specifies the numbers to subtract from the coordinates of point. |
Returns:
PointF - The translated com.aspose.imaging.PointF.
isEquals(PointF obj1, PointF obj2)
public static boolean isEquals(PointF obj1, PointF obj2)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| obj1 | PointF | |
| obj2 | PointF |
Returns: boolean
isEmpty()
public boolean isEmpty()
Gets a value indicating whether this com.aspose.imaging.PointF is empty.
Returns:
boolean - True if both com.aspose.imaging.PointF.X and com.aspose.imaging.PointF.Y are 0; otherwise, false.
getX()
public float getX()
Gets or sets the x-coordinate of this com.aspose.imaging.PointF.
Returns: float
setX(float value)
public void setX(float value)
Gets or sets the x-coordinate of this com.aspose.imaging.PointF.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | float |
getY()
public float getY()
Gets or sets the y-coordinate of this com.aspose.imaging.PointF.
Returns: float
setY(float value)
public void setY(float value)
Gets or sets the y-coordinate of this com.aspose.imaging.PointF.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | float |
equals(Object obj)
public boolean equals(Object obj)
Specifies whether this com.aspose.imaging.PointF contains the same coordinates as the specified System.Object.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| obj | java.lang.Object | The System.Object to test. |
Returns:
boolean - This method returns true if obj is a com.aspose.imaging.PointF and has the same coordinates as this com.aspose.imaging.Point.
hashCode()
public int hashCode()
Returns a hash code for this com.aspose.imaging.PointF structure.
Returns:
int - An integer value that specifies a hash value for this com.aspose.imaging.PointF structure.
toString()
public String toString()
Converts this com.aspose.imaging.PointF to a human readable string.
Returns:
java.lang.String - A string that represents this com.aspose.imaging.PointF.
CloneTo(PointF that)
public void CloneTo(PointF that)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| that | PointF |
Clone()
public PointF Clone()
Returns: PointF