Point.Add(Point, Vector) 方法

定义

VectorPoint 相加并将结果以 Point 结构返回。

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

参数

point
Point

要添加的 Point 结构。

vector
Vector

要添加的 Vector 结构。

返回

返回 pointvector 的总和。

示例

此示例将 添加到 PointVector 并将结果作为 Vector 结构返回。

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

    // Add Point and Vector using the static Add method.
    // pointResult is equal to (30,35).
    Point pointResult = Point.Add(point1, vector1);

    return pointResult;
}

注解

禁止向PointPoint结构添加结构。

适用于

另请参阅