Point.Add Method (Point, Vector)

 

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

Namespace:   System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)

public static Point Add(
	Point point,
	Vector vector
)

Parameters

point
Type: System.Windows.Point

The Point structure to add.

vector
Type: System.Windows.Vector

The Vector structure to add.

Return Value

Type: System.Windows.Point

Returns the sum of point and vector.

Adding a Point structure to a Point structure is prohibited.

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

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;

}

.NET Framework
Available since 3.0
Return to top
Show: