Point
Struct · namespace System.Drawing · Since 0.45
struct Point : IEquatable<Point>, IHashableA position in pixels: X to the right, Y down; (0, 0) is the top left corner.
Fields
Section titled “Fields”| Name | Description |
|---|---|
X |
The horizontal position. |
Y |
The vertical position. |
int XThe horizontal position.
int YThe vertical position.
Static methods
Section titled “Static methods”| Name | Description |
|---|---|
Create |
The point (x, y). |
Zero |
The point (0, 0). |
Create
Section titled “Create”static Point Create(int x, int y)The point (x, y).
static Point Zero()The point (0, 0).
Methods
Section titled “Methods”| Name | Description |
|---|---|
Add |
This point moved by other. |
Subtract |
This point moved back by other: the distance from other to this point. |
Offset |
This point moved by (dx, dy). |
Scale |
Both coordinates multiplied by factor. |
ToVector |
The point as a Vector2. |
Equals |
Whether both coordinates are equal. |
GetHashCode |
A hash code of both coordinates. |
ToString |
“(x, y)”. |
Point Add(Point other)This point moved by other.
Subtract
Section titled “Subtract”Point Subtract(Point other)This point moved back by other: the distance from other to this point.
Offset
Section titled “Offset”Point Offset(int dx, int dy)This point moved by (dx, dy).
Point Scale(int factor)Both coordinates multiplied by factor.
ToVector
Section titled “ToVector”Vector2 ToVector()The point as a Vector2.
Equals
Section titled “Equals”bool Equals(Point other)Whether both coordinates are equal.
GetHashCode
Section titled “GetHashCode”int GetHashCode()A hash code of both coordinates.
ToString
Section titled “ToString”string ToString()“(x, y)”.