Struct Point
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.
public struct Point
- Inherited Members
Constructors
Point(Size)
public Point(Size size)
Parameters
size
SizeContains the new point coordinates.
Point(int)
Initializes a new instance of the Point structure using coordinates specified by an integer value.
public Point(int dw)
Parameters
dw
intA 32-bit integer that specifies the coordinates for the new point.
Point(int, int)
Initializes a new instance of the Point structure with the specified coordinates.
public Point(int x, int y)
Parameters
Properties
Empty
public static Point Empty { get; }
Property Value
IsEmpty
Gets a value indicating whether this Point is empty.
public bool IsEmpty { get; }
Property Value
X
Gets or sets the x-coordinate of this Point.
public int X { get; set; }
Property Value
Y
Gets or sets the y-coordinate of this Point.
public int Y { get; set; }
Property Value
Methods
Add(Point, Size)
public static Point Add(Point point, Size size)
Parameters
Returns
Ceiling(PointF)
Converts the specified PointF to a Point by rounding the values of the PointF to the next higher integer values.
public static Point Ceiling(PointF point)
Parameters
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
Returns
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
longThe Point object packed into one long value.
x
intThe extracted from the packed Point X value.
y
intThe extracted from the packed Point Y value.
GetHashCode()
Returns a hash code for this Point.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Offset(Point)
public void Offset(Point point)
Parameters
Offset(int, int)
Translates this Point by the specified amount.
public void Offset(int dx, int dy)
Parameters
Round(PointF)
Converts the specified PointF to a Point object by rounding the Point values to the nearest integer.
public static Point Round(PointF point)
Parameters
Returns
Subtract(Point, Size)
public static Point Subtract(Point point, Size size)
Parameters
Returns
ToLong()
Convert this Point to a single long value, containing X and Y coordinates in high and low bits.
public long ToLong()
Returns
- long
The Point object packed into one long value.
ToString()
Converts this Point to a human-readable string.
public override string ToString()
Returns
Truncate(PointF)
public static Point Truncate(PointF point)
Parameters
Returns
Operators
operator +(Point, Size)
public static Point operator +(Point point, Size size)
Parameters
point
PointThe Point to translate.
size
SizeA Size that specifies the pair of numbers to add to the coordinates of
point
.
Returns
operator ==(Point, Point)
Compares two Point objects. The result specifies whether the values of the X and Y properties of the two Point objects are equal.
public static bool operator ==(Point point1, Point point2)
Parameters
Returns
explicit operator Size(Point)
public static explicit operator Size(Point point)
Parameters
Returns
implicit operator PointF(Point)
public static implicit operator PointF(Point point)
Parameters
Returns
operator !=(Point, Point)
Compares two Point objects. The result specifies whether the values of the X or Y properties of the two Point objects are unequal.
public static bool operator !=(Point point1, Point point2)
Parameters
Returns
- bool
True if the values of either the X properties or the Y properties of
point1
andpoint2
differ; otherwise, false.
operator -(Point, Size)
public static Point operator -(Point point, Size size)
Parameters
point
PointThe Point to translate.
size
SizeA Size that specifies the pair of numbers to subtract from the coordinates of
point
.