Struct Point
Point - Defaults to 0,0
Inherited Members
Namespace:ImGui
Assembly:ImGui.dll
Syntax
[Serializable]
public struct Point
Constructors
| Improve this DocPoint(Double, Double)
Constructor which accepts the X and Y values
Declaration
public Point(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x | The value for the X coordinate of the new Point |
System.Double | y | The value for the Y coordinate of the new Point |
Fields
| Improve this DocInvalid
Declaration
public static readonly Point Invalid
Field Value
Type | Description |
---|---|
Point |
Zero
Declaration
public static readonly Point Zero
Field Value
Type | Description |
---|---|
Point |
Properties
| Improve this DocX
X - double. Default value is 0.
Declaration
public double X { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Y
Y - double. Default value is 0.
Declaration
public double Y { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this DocAdd(Point, Vector)
Add: Point + Vector
Declaration
public static Point Add(Point point, Vector vector)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The Point to be added to the Vector |
Vector | vector | The Vector to be added to the Point |
Returns
Type | Description |
---|---|
Point | Point - The result of the addition |
Equals(Point)
Equals - compares this Point with the passed in object. In this equality double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail.
Declaration
public bool Equals(Point value)
Parameters
Type | Name | Description |
---|---|---|
Point | value | The Point to compare to "this" |
Returns
Type | Description |
---|---|
System.Boolean | bool - true if "value" is equal to "this". |
Equals(Point, Point)
Compares two Point instances for object equality. In this equality double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail.
Declaration
public static bool Equals(Point point1, Point point2)
Parameters
Type | Name | Description |
---|---|---|
Point | point1 | The first Point to compare |
Point | point2 | The second Point to compare |
Returns
Type | Description |
---|---|
System.Boolean | bool - true if the two Point instances are exactly equal, false otherwise |
Equals(Object)
Equals - compares this Point with the passed in object. In this equality double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
System.Object | o | The object to compare to "this" |
Returns
Type | Description |
---|---|
System.Boolean | bool - true if the object is an instance of Point and if it's equal to "this". |
Overrides
GetHashCode()
Returns the HashCode for this Point
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | int - the HashCode for this Point |
Overrides
Offset(Double, Double)
Offset - update the location by adding offsetX to X and offsetY to Y
Declaration
public void Offset(double offsetX, double offsetY)
Parameters
Type | Name | Description |
---|---|---|
System.Double | offsetX | The offset in the x dimension |
System.Double | offsetY | The offset in the y dimension |
Parse(String)
Parse - returns an instance converted from the provided string using the culture "en-US"
string with Point dataDeclaration
public static Point Parse(string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | source |
Returns
Type | Description |
---|---|
Point |
Subtract(Point, Point)
Subtract: Point - Point
Declaration
public static Vector Subtract(Point point1, Point point2)
Parameters
Type | Name | Description |
---|---|---|
Point | point1 | The Point from which point2 is subtracted |
Point | point2 | The Point subtracted from point1 |
Returns
Type | Description |
---|---|
Vector | Vector - The result of the subtraction |
Subtract(Point, Vector)
Subtract: Point - Vector
Declaration
public static Point Subtract(Point point, Vector vector)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The Point from which the Vector is subtracted |
Vector | vector | The Vector which is subtracted from the Point |
Returns
Type | Description |
---|---|
Point | Point - The result of the subtraction |
ToString()
Creates a string representation of this object based on the current culture.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string representation of this object. |
Overrides
Operators
| Improve this DocAddition(Point, Vector)
Operator Point + Vector
Declaration
public static Point operator +(Point point, Vector vector)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The Point to be added to the Vector |
Vector | vector | The Vectr to be added to the Point |
Returns
Type | Description |
---|---|
Point | Point - The result of the addition |
Equality(Point, Point)
Compares two Point instances for exact equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail. Furthermore, using this equality operator, double.NaN is not equal to itself.
Declaration
public static bool operator ==(Point point1, Point point2)
Parameters
Type | Name | Description |
---|---|---|
Point | point1 | The first Point to compare |
Point | point2 | The second Point to compare |
Returns
Type | Description |
---|---|
System.Boolean | bool - true if the two Point instances are exactly equal, false otherwise |
Explicit(Point to Size)
Explicit conversion to Size. Note that since Size cannot contain negative values, the resulting size will contains the absolute values of X and Y
Declaration
public static explicit operator Size(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | Point - the Point to convert to a Size |
Returns
Type | Description |
---|---|
Size | Size - A Size equal to this Point |
Explicit(Point to Vector)
Explicit conversion to Vector
Declaration
public static explicit operator Vector(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | Point - the Point to convert to a Vector |
Returns
Type | Description |
---|---|
Vector | Vector - A Vector equal to this Point |
Inequality(Point, Point)
Compares two Point instances for exact inequality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail. Furthermore, using this equality operator, double.NaN is not equal to itself.
Declaration
public static bool operator !=(Point point1, Point point2)
Parameters
Type | Name | Description |
---|---|---|
Point | point1 | The first Point to compare |
Point | point2 | The second Point to compare |
Returns
Type | Description |
---|---|
System.Boolean | bool - true if the two Point instances are exactly unequal, false otherwise |
Subtraction(Point, Point)
Operator Point - Point
Declaration
public static Vector operator -(Point point1, Point point2)
Parameters
Type | Name | Description |
---|---|---|
Point | point1 | The Point from which point2 is subtracted |
Point | point2 | The Point subtracted from point1 |
Returns
Type | Description |
---|---|
Vector | Vector - The result of the subtraction |
Subtraction(Point, Vector)
Operator Point - Vector
Declaration
public static Point operator -(Point point, Vector vector)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The Point from which the Vector is subtracted |
Vector | vector | The Vector which is subtracted from the Point |
Returns
Type | Description |
---|---|
Point | Point - The result of the subtraction |