Point

Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.lang.Struct

public class Point extends Struct<Point>

Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.

Constructors

ConstructorDescription
Point()
Point(int x, int y)Initializes a new instance of the Aspose.Imaging.Point structure with the specified coordinates.
Point(Size size)Initializes a new instance of the Aspose.Imaging.Point structure from the Aspose.Imaging.Size structure.
Point(int dw)Initializes a new instance of the Aspose.Imaging.Point structure using coordinates specified by an integer value.

Methods

MethodDescription
getEmpty()Gets a new instance of the Aspose.Imaging.Point structure that has Aspose.Imaging.Point.X and Aspose.Imaging.Point.Y values set to zero.
add(Point point, Size size)Adds the specified Aspose.Imaging.Size to the specified Aspose.Imaging.Point.
subtract(Point point, Size size)Returns the result of subtracting specified Aspose.Imaging.Size from the specified Aspose.Imaging.Point.
ceiling(PointF point)Converts the specified Aspose.Imaging.PointF to a Aspose.Imaging.Point by rounding the values of the Aspose.Imaging.PointF to the next higher integer values.
round(PointF point)Converts the specified Aspose.Imaging.PointF to a Aspose.Imaging.Point object by rounding the Aspose.Imaging.Point values to the nearest integer.
truncate(PointF point)Converts the specified Aspose.Imaging.PointF to a Aspose.Imaging.Point by truncating the values of the Aspose.Imaging.Point.
op_Addition(Point point, Size size)Translates a Aspose.Imaging.Point by a given Aspose.Imaging.Size.
op_Subtraction(Point point, Size size)Translates a Aspose.Imaging.Point by the negative of a given Aspose.Imaging.Size.
op_Equality(Point point1, Point point2)Compares two Aspose.Imaging.Point objects.
op_Inequality(Point point1, Point point2)Compares two Aspose.Imaging.Point objects.
to_Size(Point point)Converts the specified Aspose.Imaging.Point structure to a Aspose.Imaging.Size structure.
to_PointF(Point point)Converts the specified Point structure to the PointF structure.
fromLong(long packedPoint, int[] x, int[] y)Deconstruct a Point object packed into a long object to separate X and Y int values.
isEquals(Point obj1, Point obj2)
isEmpty()Gets a value indicating whether this Aspose.Imaging.Point is empty.
getX()Gets or sets the x-coordinate of this Aspose.Imaging.Point.
setX(int value)Gets or sets the x-coordinate of this Aspose.Imaging.Point.
getY()Gets or sets the y-coordinate of this Aspose.Imaging.Point.
setY(int value)Gets or sets the y-coordinate of this Aspose.Imaging.Point.
offset(Point point)Translates this Aspose.Imaging.Point by the specified Aspose.Imaging.Point.
offset(int dx, int dy)Translates this Aspose.Imaging.Point by the specified amount.
equals(Object obj)Specifies whether this Aspose.Imaging.Point contains the same coordinates as the specified System.Object.
hashCode()Returns a hash code for this Aspose.Imaging.Point.
toLong()Convert this Point to a single long value, containing X and Y coordinates in high and low bits.
toString()Converts this Aspose.Imaging.Point to a human-readable string.
CloneTo(Point that)
Clone()

Point()

public Point()

Point(int x, int y)

public Point(int x, int y)

Initializes a new instance of the Aspose.Imaging.Point structure with the specified coordinates.

Parameters:

ParameterTypeDescription
xintThe horizontal position of the point.
yintThe vertical position of the point.

Point(Size size)

public Point(Size size)

Initializes a new instance of the Aspose.Imaging.Point structure from the Aspose.Imaging.Size structure.

Parameters:

ParameterTypeDescription
sizeSizeContains the new point coordinates.

Point(int dw)

public Point(int dw)

Initializes a new instance of the Aspose.Imaging.Point structure using coordinates specified by an integer value.

Parameters:

ParameterTypeDescription
dwintA 32-bit integer that specifies the coordinates for the new point.

getEmpty()

public static Point getEmpty()

Gets a new instance of the Aspose.Imaging.Point structure that has Aspose.Imaging.Point.X and Aspose.Imaging.Point.Y values set to zero.

Returns: Point

add(Point point, Size size)

public static Point add(Point point, Size size)

Adds the specified Aspose.Imaging.Size to the specified Aspose.Imaging.Point.

Parameters:

ParameterTypeDescription
pointPointThe Aspose.Imaging.Point to add to.
sizeSizeThe Aspose.Imaging.Size to add to the point.

Returns: Point - The Aspose.Imaging.Point that is the result of the addition operation.

subtract(Point point, Size size)

public static Point subtract(Point point, Size size)

Returns the result of subtracting specified Aspose.Imaging.Size from the specified Aspose.Imaging.Point.

Parameters:

ParameterTypeDescription
pointPointThe Aspose.Imaging.Point to be subtracted from.
sizeSizeThe Aspose.Imaging.Size to subtract from the point.

Returns: Point - The Aspose.Imaging.Point that is the result of the subtraction operation.

ceiling(PointF point)

public static Point ceiling(PointF point)

Converts the specified Aspose.Imaging.PointF to a Aspose.Imaging.Point by rounding the values of the Aspose.Imaging.PointF to the next higher integer values.

Parameters:

ParameterTypeDescription
pointPointFThe Aspose.Imaging.PointF to convert.

Returns: Point - The Aspose.Imaging.Point this method converts to.

round(PointF point)

public static Point round(PointF point)

Converts the specified Aspose.Imaging.PointF to a Aspose.Imaging.Point object by rounding the Aspose.Imaging.Point values to the nearest integer.

Parameters:

ParameterTypeDescription
pointPointFThe Aspose.Imaging.PointF to convert.

Returns: Point - The Aspose.Imaging.Point this method converts to.

truncate(PointF point)

public static Point truncate(PointF point)

Converts the specified Aspose.Imaging.PointF to a Aspose.Imaging.Point by truncating the values of the Aspose.Imaging.Point.

Parameters:

ParameterTypeDescription
pointPointFThe Aspose.Imaging.PointF to convert.

Returns: Point - The Aspose.Imaging.Point this method converts to.

op_Addition(Point point, Size size)

public static Point op_Addition(Point point, Size size)

Translates a Aspose.Imaging.Point by a given Aspose.Imaging.Size.

Parameters:

ParameterTypeDescription
pointPointThe Aspose.Imaging.Point to translate.
sizeSizeA Aspose.Imaging.Size that specifies the pair of numbers to add to the coordinates of point.

Returns: Point - The translated Aspose.Imaging.Point.

op_Subtraction(Point point, Size size)

public static Point op_Subtraction(Point point, Size size)

Translates a Aspose.Imaging.Point by the negative of a given Aspose.Imaging.Size.

Parameters:

ParameterTypeDescription
pointPointThe Aspose.Imaging.Point to translate.
sizeSizeA Aspose.Imaging.Size that specifies the pair of numbers to subtract from the coordinates of point.

Returns: Point - A Aspose.Imaging.Point structure that is translated by the negative of a given Aspose.Imaging.Size structure.

op_Equality(Point point1, Point point2)

public static boolean op_Equality(Point point1, Point point2)

Compares two Aspose.Imaging.Point objects. The result specifies whether the values of the Aspose.Imaging.Point.X and Aspose.Imaging.Point.Y properties of the two Aspose.Imaging.Point objects are equal.

Parameters:

ParameterTypeDescription
point1PointA first Aspose.Imaging.Point to compare.
point2PointA second Aspose.Imaging.Point to compare.

Returns: boolean - True if the Aspose.Imaging.Point.X and Aspose.Imaging.Point.Y values of point1 and point2 are equal; otherwise, false.

op_Inequality(Point point1, Point point2)

public static boolean op_Inequality(Point point1, Point point2)

Compares two Aspose.Imaging.Point objects. The result specifies whether the values of the Aspose.Imaging.Point.X or Aspose.Imaging.Point.Y properties of the two Aspose.Imaging.Point objects are unequal.

Parameters:

ParameterTypeDescription
point1PointA first Aspose.Imaging.Point to compare.
point2PointA second Aspose.Imaging.Point to compare.

Returns: boolean - True if the values of either the Aspose.Imaging.Point.X properties or the Aspose.Imaging.Point.Y properties of point1 and point2 differ; otherwise, false.

to_Size(Point point)

public static Size to_Size(Point point)

Converts the specified Aspose.Imaging.Point structure to a Aspose.Imaging.Size structure.

Parameters:

ParameterTypeDescription
pointPointThe Aspose.Imaging.Point to be converted.

Returns: Size - The Aspose.Imaging.Size that results from the conversion.

to_PointF(Point point)

public static PointF to_PointF(Point point)

Converts the specified Point structure to the PointF structure.

Parameters:

ParameterTypeDescription
pointPointThe Point to be converted.

Returns: PointF - The PointF that results from the conversion.

fromLong(long packedPoint, int[] x, int[] y)

public static void fromLong(long packedPoint, int[] x, int[] y)

Deconstruct a Point object packed into a long object to separate X and Y int values.

Parameters:

ParameterTypeDescription
packedPointlongThe Point object packed into one long value.
xint[]The extracted from the packed Point X value.
yint[]The extracted from the packed Point Y value.

isEquals(Point obj1, Point obj2)

public static boolean isEquals(Point obj1, Point obj2)

Parameters:

ParameterTypeDescription
obj1Point
obj2Point

Returns: boolean

isEmpty()

public boolean isEmpty()

Gets a value indicating whether this Aspose.Imaging.Point is empty.

Returns: boolean - True if both Aspose.Imaging.Point.X and Aspose.Imaging.Point.Y are 0; otherwise, false.

getX()

public int getX()

Gets or sets the x-coordinate of this Aspose.Imaging.Point.

Returns: int

setX(int value)

public void setX(int value)

Gets or sets the x-coordinate of this Aspose.Imaging.Point.

Parameters:

ParameterTypeDescription
valueint

getY()

public int getY()

Gets or sets the y-coordinate of this Aspose.Imaging.Point.

Returns: int

setY(int value)

public void setY(int value)

Gets or sets the y-coordinate of this Aspose.Imaging.Point.

Parameters:

ParameterTypeDescription
valueint

offset(Point point)

public void offset(Point point)

Translates this Aspose.Imaging.Point by the specified Aspose.Imaging.Point.

Parameters:

ParameterTypeDescription
pointPointThe Aspose.Imaging.Point used to offset this Aspose.Imaging.Point.

offset(int dx, int dy)

public void offset(int dx, int dy)

Translates this Aspose.Imaging.Point by the specified amount.

Parameters:

ParameterTypeDescription
dxintThe amount to offset the x-coordinate.
dyintThe amount to offset the y-coordinate.

equals(Object obj)

public boolean equals(Object obj)

Specifies whether this Aspose.Imaging.Point contains the same coordinates as the specified System.Object.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe System.Object to test.

Returns: boolean - True if obj is a Aspose.Imaging.Point and has the same coordinates as this Aspose.Imaging.Point.

hashCode()

public int hashCode()

Returns a hash code for this Aspose.Imaging.Point.

Returns: int - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

toLong()

public final long toLong()

Convert this Point to a single long value, containing X and Y coordinates in high and low bits.

Returns: long - The Point object packed into one long value.

toString()

public String toString()

Converts this Aspose.Imaging.Point to a human-readable string.

Returns: java.lang.String - A System.String that represents this instance.

CloneTo(Point that)

public void CloneTo(Point that)

Parameters:

ParameterTypeDescription
thatPoint

Clone()

public Point Clone()

Returns: Point