Point.Addition(Point, Vector) 运算符

定义

将指定的 Point 平移指定的 Vector 并返回结果。

public:
 static System::Windows::Point operator +(System::Windows::Point point, System::Windows::Vector vector);
public static System.Windows.Point operator + (System.Windows.Point point, System.Windows.Vector vector);
static member ( + ) : System.Windows.Point * System.Windows.Vector -> System.Windows.Point
Public Shared Operator + (point As Point, vector As Vector) As Point

参数

point
Point

要平移的点。

vector
Vector

point 的平移量。

返回

Point

将指定点平移指定的向量所得的结果。

示例

以下示例演示如何使用重载的 (+) 运算符向 a Vector 添加 aPoint

private Point overloadedAdditionOperatorExample()
{
        
    Point point1 = new Point(10, 5);
    Vector vector1 = new Vector(20, 30);

    // Add point to a Vector using the overloaded (+) operator.
    // pointResult is equal to (30,35).
    Point pointResult = point1 + vector1;

    return pointResult;
}
Private Function overloadedAdditionOperatorExample() As Point

    Dim point1 As New Point(10, 5)
    Dim vector1 As New Vector(20, 30)

    ' Add point to a Vector using the overloaded (+) operator.
    ' pointResult is equal to (30,35).
    Dim pointResult As Point = point1 + vector1

    Return pointResult

End Function

适用于

另请参阅