Struct Point
Represents an x- and y-coordinate pair in two-dimensional space. Can also represent a logical point for certain property usages.
Implements
Inherited Members
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public struct Point : IFormattable
Constructors
| Improve this Doc View SourcePoint(Double, Double)
Initializes a Point structure that contains the specified values. contains the specified values.
Declaration
public Point(double x, double y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | The x-coordinate value of the Point structure. |
| System.Double | y | The y-coordinate value of the Point structure. |
Properties
| Improve this Doc View SourceX
Declaration
public double X { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The X-coordinate value of this Point structure. The default value is 0. |
Y
Declaration
public double Y { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The Y-coordinate value of this Point structure. The default value is 0. |
Methods
| Improve this Doc View SourceAdd(Point, Vector)
Declaration
public static Point Add(Point point, Vector vector)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | The Point structure to add. |
| Vector | vector | The Vector structure to add. |
Returns
| Type | Description |
|---|---|
| Point | Returns the sum of point and vector. |
Equals(Object)
Determines whether the specified object is a Point and whether it contains the same values as this Point.
Declaration
public override bool Equals(object o)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | o | The object to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if obj is a Point and contains the same X and Y values as this Point; otherwise, false. |
Overrides
Equals(Point)
Compares two Point structures for equality.
Declaration
public bool Equals(Point value)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | value | The point to compare to this instance. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if both Point structures contain the same X and Y values; otherwise, false. |
Equals(Point, Point)
Compares two Point structures for equality.
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 | true if point1 and point2 contain the same X and Y values; otherwise, false. |
GetHashCode()
Returns the hash code for this Point.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | The hash code for this Point structure. |
Overrides
Multiply(Point, Matrix)
Declaration
public static Point Multiply(Point point, Matrix matrix)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | The point to transform. |
| Matrix | matrix | The transformation matrix. |
Returns
| Type | Description |
|---|---|
| Point | The transformed point. |
Offset(Double, Double)
Declaration
public void Offset(double offsetX, double offsetY)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | offsetX | The amount to offset the point's X coordinate. |
| System.Double | offsetY | The amount to offset the point's Y coordinate. |
Parse(String)
Constructs a Point from the specified System.String.
Declaration
public static Point Parse(string source)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | source | A string representation of a point. |
Returns
| Type | Description |
|---|---|
| Point | The equivalent Point structure. |
Exceptions
| Type | Condition |
|---|---|
| System.FormatException | source is not composed of two comma- or space-delimited double values. |
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 to subtract from point1. |
Returns
| Type | Description |
|---|---|
| Vector | The difference between point1 and point2. |
Subtract(Point, Vector)
Declaration
public static Point Subtract(Point point, Vector vector)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | |
| Vector | vector | The vector to subtract from point. |
Returns
| Type | Description |
|---|---|
| Point | The difference between point and vector. |
ToString()
Creates a System.String representation of this Point.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A System.String containing the X and Y values of this Point structure. |
Overrides
ToString(IFormatProvider)
Creates a System.String representation of this Point.
Declaration
public string ToString(IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IFormatProvider | provider | Culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| System.String | A System.String containing the X and Y values of this Point structure. |
Operators
| Improve this Doc View SourceAddition(Point, Vector)
Declaration
public static Point operator +(Point point, Vector vector)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | The point to translate. |
| Vector | vector | The amount by which to translate point. |
Returns
| Type | Description |
|---|---|
| Point | The result of translating the specified point by the specified vector. |
Equality(Point, Point)
Compares two Point structures for equality.
Declaration
public static bool operator ==(Point point1, Point point2)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point1 | The first Point structure to compare. |
| Point | point2 | The second Point structure to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if both the X and Y values of point1 and point2 are equal; otherwise, false. |
Explicit(Point to Size)
Creates a Size structure with a Width equal to this point's X value and a Height equal to this point's Y value.
Declaration
public static explicit operator Size(Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | The point to convert. |
Returns
| Type | Description |
|---|---|
| Size | A Size structure with a Width equal to this point's X value and a Height equal to this point's Y value. |
Explicit(Point to Vector)
Creates a Vector structure with an X value equal to the point's X value and a Y value equal to the point's Y value.
Declaration
public static explicit operator Vector(Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | The point to convert. |
Returns
| Type | Description |
|---|---|
| Vector | A vector with an X value equal to the point's X value and a Y value equal to the point's Y value. |
Inequality(Point, Point)
Compares two Point structures for inequality
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 | true if point1 and point2 have different X or Y values; false if point1 and point2 have the same X and Y values. |
Multiply(Point, Matrix)
Declaration
public static Point operator *(Point point, Matrix matrix)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | The point to transform. |
| Matrix | matrix | The transformation matrix. |
Returns
| Type | Description |
|---|---|
| Point | The result of transforming the specified point using the specified matrix. |
Subtraction(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 to subtract from point1. |
Returns
| Type | Description |
|---|---|
| Vector | The difference between point1 and point2. |
Subtraction(Point, Vector)
Declaration
public static Point operator -(Point point, Vector vector)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | point | The point from which vector is subtracted. |
| Vector | vector | The vector to subtract from point1. |
Returns
| Type | Description |
|---|---|
| Point | The difference between point and vector. |
Explicit Interface Implementations
| Improve this Doc View SourceIFormattable.ToString(String, IFormatProvider)
Creates a string representation of this object based on the format string and IFormatProvider passed in. If the provider is null, the CurrentCulture is used. See the documentation for IFormattable for more information.
Declaration
string IFormattable.ToString(string format, IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | format | |
| System.IFormatProvider | provider |
Returns
| Type | Description |
|---|---|
| System.String | A string representation of this object. |