Point.Add(Point, Vector) Method

Definition

Adds a Vector to a Point and returns the result as a Point structure.

C#
public static System.Windows.Point Add(System.Windows.Point point, System.Windows.Vector vector);

Parameters

point
Point

The Point structure to add.

vector
Vector

The Vector structure to add.

Returns

Returns the sum of point and vector.

Examples

This example adds a Point to a Vector and returns the result as a Vector structure.

C#
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;
}

Remarks

Adding a Point structure to a Point structure is prohibited.

Applies to

Proizvod Verzije
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also