Struct Point
Represents an ordered pair of integer x- and y-coordinates.
Implements
Inherited Members
Namespace: DRIT.Drawing.Geometry
Assembly: DRIT.Drawing.dll
Syntax
public struct Point : IEquatable<Point>
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Constructors
Point(Size)
Declaration
public Point(Size sz)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | sz | The size to convert to a point. |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Point(int, int)
Initializes a new Point with the specified coordinates.
Declaration
public Point(int x, int y)
Parameters
| Type | Name | Description |
|---|---|---|
| int | x | The x-coordinate. |
| int | y | The y-coordinate. |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Fields
Empty
Gets an empty Point (0, 0).
Declaration
public static readonly Point Empty
Field Value
| Type | Description |
|---|---|
| Point |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
X
Gets or sets the x-coordinate.
Declaration
public int X
Field Value
| Type | Description |
|---|---|
| int |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Y
Gets or sets the y-coordinate.
Declaration
public int Y
Field Value
| Type | Description |
|---|---|
| int |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Properties
IsEmpty
Gets a value indicating whether this point is empty (0, 0).
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Methods
Add(Point, Size)
Adds the specified point and size.
Declaration
public static Point Add(Point pt, Size sz)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | pt | The point to add to. |
| Size | sz | The size to add. |
Returns
| Type | Description |
|---|---|
| Point | The resulting point. |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Equals(Point)
Indicates whether this point is equal to another point.
Declaration
public bool Equals(Point other)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | other | The point to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Equals(object?)
Indicates whether this point is equal to another object.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
Overrides
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
GetHashCode()
Returns a hash code for this point.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | The hash code. |
Overrides
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Offset(Point)
Translates the point by the offsets of another point.
Declaration
public void Offset(Point p)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | p | The point containing the offsets. |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Offset(int, int)
Translates the point by the specified offsets.
Declaration
public void Offset(int dx, int dy)
Parameters
| Type | Name | Description |
|---|---|---|
| int | dx | The horizontal offset. |
| int | dy | The vertical offset. |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Subtract(Point, Size)
Subtracts the specified size from the point.
Declaration
public static Point Subtract(Point pt, Size sz)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | pt | The point to subtract from. |
| Size | sz | The size to subtract. |
Returns
| Type | Description |
|---|---|
| Point | The resulting point. |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
ToString()
Returns a string representation of this point.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string in the format "{X=value, Y=value}". |
Overrides
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Operators
operator +(Point, Size)
Adds a point and a size.
Declaration
public static Point operator +(Point pt, Size sz)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | pt | |
| Size | sz |
Returns
| Type | Description |
|---|---|
| Point |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
operator ==(Point, Point)
Compares two points for equality.
Declaration
public static bool operator ==(Point left, Point right)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | left | |
| Point | right |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
explicit operator Size(Point)
Declaration
public static explicit operator Size(Point p)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | p |
Returns
| Type | Description |
|---|---|
| Size |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
implicit operator PointF(Point)
Declaration
public static implicit operator PointF(Point p)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | p |
Returns
| Type | Description |
|---|---|
| PointF |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
operator !=(Point, Point)
Compares two points for inequality.
Declaration
public static bool operator !=(Point left, Point right)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | left | |
| Point | right |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
operator -(Point, Size)
Subtracts a size from a point.
Declaration
public static Point operator -(Point pt, Size sz)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | pt | |
| Size | sz |
Returns
| Type | Description |
|---|---|
| Point |
Remarks
A Point represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.