# PointPointPointPoint Struct

## 定义

``public value class Point : IFormattable``
``````[System.ComponentModel.TypeConverter(typeof(System.Windows.PointConverter))]
[System.Serializable]
public struct Point : IFormattable``````
``````type Point = struct
interface IFormattable``````
``````Public Structure Point
Implements IFormattable``````

PointPointPointPoint

## 示例

``````// Checks if two Points are equal using the overloaded inequality operator.
private Boolean pointInequalityExample()
{
// Checks if two Points are not equal using the overloaded inequality operator.

// Declaring point1 and initializing x,y values
Point point1 = new Point(10, 5);

// Declaring point2 without initializing x,y values
Point point2 = new Point();

// Boolean to hold the result of the comparison
Boolean areNotEqual;

// assigning values to point2
point2.X = 15;
point2.Y = 40;

// Compare Point structures for equality.
// areNotEqual is True
areNotEqual = (point1 != point2);

return areNotEqual;

}
``````
``````' Checks if two Points are equal using the overloaded inequality operator.
Private Function pointInequalityExample() As Boolean
' Checks if two Points are not equal using the overloaded inequality operator.

' Declaring point1 and initializing x,y values
Dim point1 As New Point(10, 5)

' Declaring point2 without initializing x,y values
Dim point2 As New Point()

' Boolean to hold the result of the comparison
Dim areNotEqual As Boolean

' assigning values to point2
point2.X = 15
point2.Y = 40

' Compare Point structures for equality.
' areNotEqual is True
areNotEqual = (point1 <> point2)

Return areNotEqual

End Function
``````

## 注解

### XAML 属性用法XAML Attribute Usage

``````<object property="x,y"/>
-or-
<object property="x y"/>
``````

### XAML 值XAML Values

xx
Point 的 x 坐标。The x-coordinate of this Point.

yy
Point 的 y 坐标。The y-coordinate of this Point.

## 构造函数

 Point(Double, Double) Point(Double, Double) Point(Double, Double) Point(Double, Double) 创建一个包含指定坐标的新 Point 结构。Creates a new Point structure that contains the specified coordinates.

## 属性

 X X X X 获取或设置此 X 结构的 Point 坐标值。Gets or sets the X-coordinate value of this Point structure. Y Y Y Y 获取或设置此 Y 的 Point 坐标值。Gets or sets the Y-coordinate value of this Point.

## 方法

 Add(Point, Vector) Add(Point, Vector) Add(Point, Vector) Add(Point, Vector) 将 Vector 与 Point 相加并将结果以 Point 结构返回。Adds a Vector to a Point and returns the result as a Point structure. Equals(Object) Equals(Object) Equals(Object) Equals(Object) 确定指定的 Object 是否是 Point 以及它是否包含与此 Point 相同的坐标。Determines whether the specified Object is a Point and whether it contains the same coordinates as this Point. Equals(Point) Equals(Point) Equals(Point) Equals(Point) 比较两个 Point 结构是否相等。Compares two Point structures for equality. Equals(Point, Point) Equals(Point, Point) Equals(Point, Point) Equals(Point, Point) 比较两个 Point 结构是否相等。Compares two Point structures for equality. GetHashCode() GetHashCode() GetHashCode() GetHashCode() 返回该 Point 的哈希代码。Returns the hash code for this Point. Multiply(Point, Matrix) Multiply(Point, Matrix) Multiply(Point, Matrix) Multiply(Point, Matrix) 使用指定的 Point 结构转换指定的 Matrix 结构。Transforms the specified Point structure by the specified Matrix structure. Offset(Double, Double) Offset(Double, Double) Offset(Double, Double) Offset(Double, Double) 将某个点的 X 坐标和 Y 坐标偏移指定的量。Offsets a point's X and Y coordinates by the specified amounts. Parse(String) Parse(String) Parse(String) Parse(String) 从指定的 Point 构造 String。Constructs a Point from the specified String. Subtract(Point, Point) Subtract(Point, Point) Subtract(Point, Point) Subtract(Point, Point) 从指定的 Point 中减去另一个指定的 Point 并将差作为 Vector 返回。Subtracts the specified Point from another specified Point and returns the difference as a Vector. Subtract(Point, Vector) Subtract(Point, Vector) Subtract(Point, Vector) Subtract(Point, Vector) 从指定的 Vector 减去指定的 Point 并返回所得的 Point。Subtracts the specified Vector from the specified Point and returns the resulting Point. ToString() ToString() ToString() ToString() 创建此 String 的 Point 表示形式。Creates a String representation of this Point. ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider) 创建此 String 的 Point 表示形式。Creates a String representation of this Point.

## 操作员

 Addition(Point, Vector) Addition(Point, Vector) Addition(Point, Vector) Addition(Point, Vector) 将指定的 Point 平移指定的 Vector 并返回结果。Translates the specified Point by the specified Vector and returns the result. Equality(Point, Point) Equality(Point, Point) Equality(Point, Point) Equality(Point, Point) 比较两个 Point 结构是否相等。Compares two Point structures for equality. Explicit(Point to Vector) Explicit(Point to Vector) Explicit(Point to Vector) Explicit(Point to Vector) 创建一个 Vector 结构，该结构的 X 值等于该点的 X 值，且 Y 值等于该点的 Y 值。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. Explicit(Point to Size) Explicit(Point to Size) Explicit(Point to Size) Explicit(Point to Size) 创建一个 Size 结构，该结构的 Width 等于此点的 X 值，且 Height 等于此点的 Y 值。Creates a Size structure with a Width equal to this point's X value and a Height equal to this point's Y value. Inequality(Point, Point) Inequality(Point, Point) Inequality(Point, Point) Inequality(Point, Point) 比较两个 Point 结构是否不相等。Compares two Point structures for inequality. Multiply(Point, Matrix) Multiply(Point, Matrix) Multiply(Point, Matrix) Multiply(Point, Matrix) 将指定的 Point 转换为指定的 Matrix。Transforms the specified Point by the specified Matrix. Subtraction(Point, Point) Subtraction(Point, Point) Subtraction(Point, Point) Subtraction(Point, Point) 从指定的 Point 中减去另一个指定的 Point 并将差作为 Vector 返回。Subtracts the specified Point from another specified Point and returns the difference as a Vector. Subtraction(Point, Vector) Subtraction(Point, Vector) Subtraction(Point, Vector) Subtraction(Point, Vector) 从指定的 Vector 减去指定的 Point 并返回所得的 Point。Subtracts the specified Vector from the specified Point and returns the resulting Point.

## 显式界面实现

 IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) 此成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构，但不能在代码中直接使用。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. 有关此成员的说明，请参见 ToString(String, IFormatProvider)。For a description of this member, see ToString(String, IFormatProvider).