Export (0) Print
Expand All

Point.Subtraction Operator (Point, Vector)

Subtracts the specified Vector from the specified Point and returns the resulting Point.

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

public static Point operator -(
	Point point,
	Vector vector


Type: System.Windows.Point

The point from which vector is subtracted.

Type: System.Windows.Vector

The vector to subtract from point1

Return Value

Type: System.Windows.Point
The difference between point and vector.

The following example shows how to subtract a Vector from a Point using the overloaded (-) operator.

private Point overloadedSubtractionOperatorExample1()

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

    // Subtracts a Vector from a Point using the overloaded subtraction (-) operator. 
    // pointResult is equal to (-10, -25)
    Point pointResult = point1 - vector1;

    return pointResult;


.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft