Skip to content
CShift0.45

Point

Struct · namespace System.Drawing · Since 0.45

struct Point : IEquatable<Point>, IHashable

A position in pixels: X to the right, Y down; (0, 0) is the top left corner.

Name Description
X The horizontal position.
Y The vertical position.
int X

The horizontal position.

int Y

The vertical position.

Name Description
Create The point (x, y).
Zero The point (0, 0).
static Point Create(int x, int y)

The point (x, y).

static Point Zero()

The point (0, 0).

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.

Point Subtract(Point other)

This point moved back by other: the distance from other to this point.

Point Offset(int dx, int dy)

This point moved by (dx, dy).

Point Scale(int factor)

Both coordinates multiplied by factor.

Vector2 ToVector()

The point as a Vector2.

bool Equals(Point other)

Whether both coordinates are equal.

int GetHashCode()

A hash code of both coordinates.

string ToString()

“(x, y)”.