Taal

Point.Subtract Methode

Definitie

Trekt de opgegeven Point of Vector van de opgegeven Pointaf.

Overloads

Name Description
Subtract(Point, Point)

Trekt de opgegeven Point waarde af van een andere opgegeven Point waarde en retourneert het verschil als een Vector.

Subtract(Point, Vector)

Trekt de opgegeven Vector waarde af van de opgegeven Point waarde en retourneert het resulterende Pointresultaat.

Subtract(Point, Point)

Trekt de opgegeven Point waarde af van een andere opgegeven Point waarde en retourneert het verschil als een 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

Het punt waaruit point2 wordt afgetrokken.

point2
Point

Het punt om af te trekken van point1.

Retouren

Het verschil tussen point1 en point2.

Voorbeelden

In het volgende voorbeeld ziet u hoe u een Point ander kunt Point aftrekken met behulp van de statische Subtract methode.

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

Zie ook

Van toepassing op

Subtract(Point, Vector)

Trekt de opgegeven Vector waarde af van de opgegeven Point waarde en retourneert het resulterende Pointresultaat.

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

Het punt waaruit vector wordt afgetrokken.

vector
Vector

De vector om af te trekken van point.

Retouren

Het verschil tussen point en vector.

Voorbeelden

In het volgende voorbeeld ziet u hoe u een aftrekken van een VectorPoint met behulp van de statische Subtract methode.

       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

Zie ook

Van toepassing op