Point.Subtract Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
Subtract(Point, Point) |
Sottrae l'oggetto Point specificato da un altro oggetto Point specificato e restituisce la differenza come oggetto Vector. |
Subtract(Point, Vector) |
Sottrae l'oggetto Vector specificato dall'oggetto Point indicato e restituisce l'oggetto Point che ne risulta. |
Subtract(Point, Point)
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
Parametri
- point1
- Point
Punto dal quale viene sottratto l'oggetto point2
.
- point2
- Point
Punto da cui sottrarre l'oggetto point1
.
Restituisce
Differenza tra point1
e point2
.
Esempio
Nell'esempio seguente viene illustrato come sottrarre un Point oggetto da un altro Point usando il metodo statico 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
Vedi anche
Si applica a
Subtract(Point, Vector)
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
Parametri
- point
- Point
Punto dal quale viene sottratto l'oggetto vector
.
- vector
- Vector
Oggetto vector
da sottrarre dall'oggetto point
.
Restituisce
Differenza tra point
e vector
.
Esempio
Nell'esempio seguente viene illustrato come sottrarre un Vector oggetto da un Point utilizzando il metodo statico Subtract .
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