Point.Subtract Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Sobrecargas
Subtract(Point, Point) |
Resta la estructura Point especificada de otra estructura Point y devuelve la diferencia como una estructura Vector. |
Subtract(Point, Vector) |
Resta la estructura Vector especificada de la estructura Point especificada y devuelve la estructura Point resultante. |
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
Parámetros
- point1
- Point
Punto del que se resta point2
.
- point2
- Point
Punto que se va a restar de point1
.
Devoluciones
Diferencia entre point1
y point2
.
Ejemplos
En el ejemplo siguiente se muestra cómo restar un Point de otro Point mediante el método estático 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
Consulte también
Se aplica 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
Parámetros
- point
- Point
Punto del que se resta vector
.
- vector
- Vector
vector
que se va a restar de point
.
Devoluciones
Diferencia entre point
y vector
.
Ejemplos
En el ejemplo siguiente se muestra cómo restar un Vector objeto de mediante Point el método estático 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