Search Results for

Show / Hide Table of Contents

# Struct Point

Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.

##### Inherited Members

System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)

###### Namespace: Terminal.Gui

###### Assembly: Terminal.Gui.dll

##### Syntax

    public struct Point

### Constructors

#### Point(Int32, Int32)

Point Constructor

##### Declaration

    public Point(int x, int y)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | x |
System.Int32 | y |

##### Remarks

Creates a Point from a specified x,y coordinate pair.

#### Point(Size)

Point Constructor

##### Declaration

    public Point(Size sz)

##### Parameters

Type | Name | Description
--- | --- | ---
Size | sz |

##### Remarks

Creates a Point from a Size value.

### Fields

#### Empty

Empty Shared Field

##### Declaration

    public static readonly Point Empty

##### Field Value

Type | Description
--- | ---
Point |

##### Remarks

An uninitialized Point Structure.

#### X

Gets or sets the x-coordinate of this Point.

##### Declaration

    public int X

##### Field Value

Type | Description
--- | ---
System.Int32 |

#### Y

Gets or sets the y-coordinate of this Point.

##### Declaration

    public int Y

##### Field Value

Type | Description
--- | ---
System.Int32 |

### Properties

#### IsEmpty

IsEmpty Property

##### Declaration

    public readonly bool IsEmpty { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

##### Remarks

Indicates if both X and Y are zero.

### Methods

#### Add(Point, Size)

Adds the specified Size to the specified Point.

##### Declaration

    public static Point Add(Point pt, Size sz)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | pt | The Point to add.
Size | sz | The Size to add.

##### Returns

Type | Description
--- | ---
Point | The Point that is the result of the addition operation.

#### Equals(Object)

Equals Method

##### Declaration

    public override bool Equals(object obj)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Object | obj |

##### Returns

Type | Description
--- | ---
System.Boolean |

##### Overrides

System.ValueType.Equals(System.Object)

##### Remarks

Checks equivalence of this Point and another object.

#### GetHashCode()

GetHashCode Method

##### Declaration

    public override int GetHashCode()

##### Returns

Type | Description
--- | ---
System.Int32 |

##### Overrides

System.ValueType.GetHashCode()

##### Remarks

Calculates a hashing value.

#### Offset(Int32, Int32)

Offset Method

##### Declaration

    public void Offset(int dx, int dy)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | dx |
System.Int32 | dy |

##### Remarks

Moves the Point a specified distance.

#### Offset(Point)

Translates this Point by the specified Point.

##### Declaration

    public void Offset(Point p)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | p | The Point used offset this Point.

#### Subtract(Point, Size)

Returns the result of subtracting specified Size from the specified Point.

##### Declaration

    public static Point Subtract(Point pt, Size sz)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | pt | The Point to be subtracted from.
Size | sz | The Size to subtract from the Point.

##### Returns

Type | Description
--- | ---
Point | The Point that is the result of the subtraction operation.

#### ToString()

ToString Method

##### Declaration

    public override string ToString()

##### Returns

Type | Description
--- | ---
System.String |

##### Overrides

System.ValueType.ToString()

##### Remarks

Formats the Point as a string in coordinate notation.

### Operators

#### Addition(Point, Size)

Addition Operator

##### Declaration

    public static Point operator +(Point pt, Size sz)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | pt |
Size | sz |

##### Returns

Type | Description
--- | ---
Point |

##### Remarks

Translates a Point using the Width and Height properties of the given Size.

#### Equality(Point, Point)

Equality Operator

##### Declaration

    public static bool operator ==(Point left, Point right)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | left |
Point | right |

##### Returns

Type | Description
--- | ---
System.Boolean |

##### Remarks

Compares two Point objects. The return value is based on the equivalence of the X and Y properties of the two points.

#### Explicit(Point to Size)

Point to Size Conversion

##### Declaration

    public static explicit operator Size(Point p)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | p |

##### Returns

Type | Description
--- | ---
Size |

##### Remarks

Returns a Size based on the Coordinates of a given Point. Requires explicit cast.

#### Inequality(Point, Point)

Inequality Operator

##### Declaration

    public static bool operator !=(Point left, Point right)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | left |
Point | right |

##### Returns

Type | Description
--- | ---
System.Boolean |

##### Remarks

Compares two Point objects. The return value is based on the equivalence of the X and Y properties of the two points.

#### Subtraction(Point, Size)

Subtraction Operator

##### Declaration

    public static Point operator -(Point pt, Size sz)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | pt |
Size | sz |

##### Returns

Type | Description
--- | ---
Point |

##### Remarks

Translates a Point using the negation of the Width and Height properties of the given Size.