Struct Point
Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.2.0)
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.
public struct Point
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Point(int, int)
Initializes a new instance of the Aspose.Imaging.Point structure with the specified coordinates.
public Point(int x, int y)
Parameters
x
int
The horizontal position of the point.
y
int
The vertical position of the point.
Point(Size)
Initializes a new instance of the Aspose.Imaging.Point structure from the Aspose.Imaging.Size structure.
public Point(Size size)
Parameters
size
Size
Contains the new point coordinates.
Point(int)
Initializes a new instance of the Aspose.Imaging.Point structure using coordinates specified by an integer value.
public Point(int dw)
Parameters
dw
int
A 32-bit integer that specifies the coordinates for the new point.
Properties
Empty
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.
public static Point Empty { get; }
Property Value
IsEmpty
Gets a value indicating whether this Aspose.Imaging.Point is empty.
[JsonIgnore]
public bool IsEmpty { get; }
Property Value
X
Gets or sets the x-coordinate of this Aspose.Imaging.Point.
public int X { get; set; }
Property Value
Y
Gets or sets the y-coordinate of this Aspose.Imaging.Point.
public int Y { get; set; }
Property Value
Methods
Add(Point, Size)
Adds the specified Aspose.Imaging.Size to the specified Aspose.Imaging.Point.
public static Point Add(Point point, Size size)
Parameters
point
Point
The Aspose.Imaging.Point to add to.
size
Size
The Aspose.Imaging.Size to add to the point
.
Returns
The Aspose.Imaging.Point that is the result of the addition operation.
Ceiling(PointF)
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.
public static Point Ceiling(PointF point)
Parameters
point
PointF
The Aspose.Imaging.PointF to convert.
Returns
The Aspose.Imaging.Point this method converts to.
Equals(object)
Specifies whether this Aspose.Imaging.Point contains the same coordinates as the specified System.Object.
public override bool Equals(object obj)
Parameters
obj
object
The System.Object to test.
Returns
True if obj
is a Aspose.Imaging.Point and has the same coordinates as this Aspose.Imaging.Point.
FromLong(long, out int, out int)
Deconstruct a Point object packed into a long object to separate X and Y int values.
public static void FromLong(long packedPoint, out int x, out int y)
Parameters
packedPoint
long
The Point object packed into one long value.
x
int
The extracted from the packed Point X value.
y
int
The extracted from the packed Point Y value.
GetHashCode()
Returns a hash code for this Aspose.Imaging.Point.
public override int GetHashCode()
Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Offset(Point)
Translates this Aspose.Imaging.Point by the specified Aspose.Imaging.Point.
public void Offset(Point point)
Parameters
point
Point
The Aspose.Imaging.Point used to offset this Aspose.Imaging.Point.
Offset(int, int)
Translates this Aspose.Imaging.Point by the specified amount.
public void Offset(int dx, int dy)
Parameters
dx
int
The amount to offset the x-coordinate.
dy
int
The amount to offset the y-coordinate.
Round(PointF)
Converts the specified Aspose.Imaging.PointF to a Aspose.Imaging.Point object by rounding the Aspose.Imaging.Point values to the nearest integer.
public static Point Round(PointF point)
Parameters
point
PointF
The Aspose.Imaging.PointF to convert.
Returns
The Aspose.Imaging.Point this method converts to.
Subtract(Point, Size)
Returns the result of subtracting specified Aspose.Imaging.Size from the specified Aspose.Imaging.Point.
public static Point Subtract(Point point, Size size)
Parameters
point
Point
The Aspose.Imaging.Point to be subtracted from.
size
Size
The Aspose.Imaging.Size to subtract from the point
.
Returns
The Aspose.Imaging.Point that is the result of the subtraction operation.
ToLong()
Convert this Point to a single long value, containing X and Y coordinates in high and low bits.
public long ToLong()
Returns
The Point object packed into one long value.
ToString()
Converts this Aspose.Imaging.Point to a human-readable string.
public override string ToString()
Returns
A System.String that represents this instance.
Truncate(PointF)
Converts the specified Aspose.Imaging.PointF to a Aspose.Imaging.Point by truncating the values of the Aspose.Imaging.Point.
public static Point Truncate(PointF point)
Parameters
point
PointF
The Aspose.Imaging.PointF to convert.
Returns
The Aspose.Imaging.Point this method converts to.
Operators
operator +(Point, Size)
Translates a Aspose.Imaging.Point by a given Aspose.Imaging.Size.
public static Point operator +(Point point, Size size)
Parameters
point
Point
The Aspose.Imaging.Point to translate.
size
Size
A Aspose.Imaging.Size that specifies the pair of numbers to add to the coordinates of point
.
Returns
The translated Aspose.Imaging.Point.
operator ==(Point, Point)
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.
public static bool operator ==(Point point1, Point point2)
Parameters
point1
Point
A first Aspose.Imaging.Point to compare.
point2
Point
A second Aspose.Imaging.Point to compare.
Returns
True if the Aspose.Imaging.Point.X and Aspose.Imaging.Point.Y values of point1
and point2
are equal; otherwise, false.
explicit operator Size(Point)
Converts the specified Aspose.Imaging.Point structure to a Aspose.Imaging.Size structure.
public static explicit operator Size(Point point)
Parameters
point
Point
The Aspose.Imaging.Point to be converted.
Returns
The Aspose.Imaging.Size that results from the conversion.
implicit operator PointF(Point)
Converts the specified Aspose.Imaging.Point structure to the Aspose.Imaging.PointF structure.
public static implicit operator PointF(Point point)
Parameters
point
Point
The Aspose.Imaging.Point to be converted.
Returns
The Aspose.Imaging.PointF that results from the conversion.
operator !=(Point, Point)
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.
public static bool operator !=(Point point1, Point point2)
Parameters
point1
Point
A first Aspose.Imaging.Point to compare.
point2
Point
A second Aspose.Imaging.Point to compare.
Returns
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.
operator -(Point, Size)
Translates a Aspose.Imaging.Point by the negative of a given Aspose.Imaging.Size.
public static Point operator -(Point point, Size size)
Parameters
point
Point
The Aspose.Imaging.Point to translate.
size
Size
A Aspose.Imaging.Size that specifies the pair of numbers to subtract from the coordinates of point
.
Returns
A Aspose.Imaging.Point structure that is translated by the negative of a given Aspose.Imaging.Size structure.