Point.Subtract 方法

定義

從指定的 Point中減去指定的 VectorPoint

多載

名稱 Description
Subtract(Point, Point)

從另一個指定PointPoint中減去,並返回差值為 Vector

Subtract(Point, Vector)

從指定Vector值減去指定Point值,並返回結果 Point

Subtract(Point, Point)

從另一個指定PointPoint中減去,並返回差值為 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

參數

point1
Point

從中減去的 point2 點。

point2
Point

從中減 point1去的點。

傳回

point1的差異point2

範例

以下範例展示了如何利用靜態Point方法從另一個 Point A Subtract 中相減。

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

另請參閱

適用於

Subtract(Point, Vector)

從指定Vector值減去指定Point值,並返回結果 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

參數

point
Point

從中減去的 vector 點。

vector
Vector

vector 減去 point

傳回

point的差異vector

範例

以下範例展示了如何利用靜態Vector方法從 a Point 中減去 aSubtract

       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

另請參閱

適用於