Point.Subtract Method

Definition

Subtrahiert den angegebenen Point oder Vector vom angegebenen Point.Subtracts the specified Point or Vector from the specified Point.

Overloads

Subtract(Point, Point)

Subtrahiert den angegebenen Point von einem anderen angegebenen Point und gibt die Differenz als Vector zurück.Subtracts the specified Point from another specified Point and returns the difference as a Vector.

Subtract(Point, Vector)

Subtrahiert den angegebenen Vector vom angegebenen Point und gibt den resultierenden Point zurück.Subtracts the specified Vector from the specified Point and returns the resulting Point.

Subtract(Point, Point)

Subtrahiert den angegebenen Point von einem anderen angegebenen Point und gibt die Differenz als Vector zurück.Subtracts the specified Point from another specified Point and returns the difference as a Vector.

public:
 static System::Windows::Vector Subtract(System::Windows::Point point1, System::Windows::Point point2);
public static System.Windows.Vector Subtract (System.Windows.Point point1, System.Windows.Point point2);
static member Subtract : System.Windows.Point * System.Windows.Point -> System.Windows.Vector
Public Shared Function Subtract (point1 As Point, point2 As Point) As Vector

Parameters

point1
Point

Der Punkt, von dem point2 subtrahiert wird.The point from which point2 is subtracted.

point2
Point

Der Punkt, der von point1 subtrahiert wird.The point to subtract from point1.

Returns

Vector

Die Differenz zwischen point1 und point2.The difference between point1 and point2.

Examples

Im folgenden Beispiel wird gezeigt, wie ein Point mithilfe der statischen Subtract-Methode von einem anderen Point subtrahiert wird.The following example shows how to subtract a Point from another Point using the static Subtract method.

private Vector subtractExample2()
{

    Point point1 = new Point(10, 5);
    Point point2 = new Point(15, 40);

    // Subtracts a Point from a Point using the static Subtract method
    // and returns the difference as a Vector.
    // vectorResult is equal to (-5, -35)
    Vector vectorResult = Point.Subtract(point1, point2);

    return vectorResult;
}
Private Function subtractExample2() As Vector

    Dim point1 As New Point(10, 5)
    Dim point2 As New Point(15, 40)

    ' Subtracts a Point from a Point using the static Subtract method
    ' and returns the difference as a Vector.
    ' vectorResult is equal to (-5, -35)
    Dim vectorResult As Vector = Point.Subtract(point1, point2)

    Return vectorResult

End Function

See also

Subtract(Point, Vector)

Subtrahiert den angegebenen Vector vom angegebenen Point und gibt den resultierenden Point zurück.Subtracts the specified Vector from the specified Point and returns the resulting Point.

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

Parameters

point
Point

Der Punkt, von dem vector subtrahiert wird.The point from which vector is subtracted.

vector
Vector

Der vector, der von point subtrahiert wird.The vector to subtract from point.

Returns

Point

Die Differenz zwischen point und vector.The difference between point and vector.

Examples

Im folgenden Beispiel wird gezeigt, wie ein Vector mithilfe der statischen Subtract-Methode von einem Point subtrahiert wird.The following example shows how to subtract a Vector from a Point using the static Subtract method.

       private Point subtractExample1()
       {

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

           // Subtracts a Vector from a Point using the static Subtract method
           // and returns the difference as a Point.
           // pointResult is equal to (-10, -25).
           Point pointResult = Point.Subtract(point1, vector1);

           return pointResult;
       }
Private Function subtractExample1() As Point

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

    ' Subtracts a Vector from a Point using the static Subtract method
    ' and returns the difference as a Point.
    ' pointResult is equal to (-10, -25).
    Dim pointResult As Point = Point.Subtract(point1, vector1)

    Return pointResult

End Function

See also

Applies to