Point.Subtraction Opérateur
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
Subtraction(Point, Point) |
Soustrait le Point spécifié d'un autre Point indiqué et retourne la différence sous forme de Vector. |
Subtraction(Point, Vector) |
Soustrait l'objet Vector spécifié du Point indiqué et retourne le Point résultant. |
Subtraction(Point, Point)
public:
static System::Windows::Vector operator -(System::Windows::Point point1, System::Windows::Point point2);
public static System.Windows.Vector operator - (System.Windows.Point point1, System.Windows.Point point2);
static member ( - ) : System.Windows.Point * System.Windows.Point -> System.Windows.Vector
Public Shared Operator - (point1 As Point, point2 As Point) As Vector
Paramètres
- point1
- Point
Point duquel point2
est soustrait.
- point2
- Point
Point à soustraire de point1
.
Retours
Différence entre point1
et point2
.
Exemples
L’exemple suivant montre comment soustraire un Point autre Point et retourner un Vector opérateur surchargé (-).
private Vector overloadedSubtractionOperatorExample2()
{
Point point1 = new Point(10, 5);
Point point2 = new Point(15, 40);
// Subtracts a Point from another Point using the overloaded subtraction (-)
// operator and returns the difference as a Vector.
// vectorResult is equal to (-5, -35).
Vector vectorResult = point1 - point2;
return vectorResult;
}
Private Function overloadedSubtractionOperatorExample2() As Vector
Dim point1 As New Point(10, 5)
Dim point2 As New Point(15, 40)
' Subtracts a Point from another Point using the overloaded subtraction (-)
' operator and returns the difference as a Vector.
' vectorResult is equal to (-5, -35).
Dim vectorResult As Vector = point1 - point2
Return vectorResult
End Function
Voir aussi
S’applique à
Subtraction(Point, Vector)
public:
static System::Windows::Point operator -(System::Windows::Point point, System::Windows::Vector vector);
public static System.Windows.Point operator - (System.Windows.Point point, System.Windows.Vector vector);
static member ( - ) : System.Windows.Point * System.Windows.Vector -> System.Windows.Point
Public Shared Operator - (point As Point, vector As Vector) As Point
Paramètres
- point
- Point
Point duquel vector
est soustrait.
- vector
- Vector
Vecteur à soustraire de point1
.
Retours
Différence entre point
et vector
.
Exemples
L’exemple suivant montre comment soustraire un Vector Point opérateur surchargé (-).
private Point overloadedSubtractionOperatorExample1()
{
Point point1 = new Point(10, 5);
Vector vector1 = new Vector(20, 30);
// Subtracts a Vector from a Point using the overloaded subtraction (-) operator.
// pointResult is equal to (-10, -25)
Point pointResult = point1 - vector1;
return pointResult;
}
Private Function overloadedSubtractionOperatorExample1() As Point
Dim point1 As New Point(10, 5)
Dim vector1 As New Vector(20, 30)
' Subtracts a Vector from a Point using the overloaded subtraction (-) operator.
' pointResult is equal to (-10, -25)
Dim pointResult As Point = point1 - vector1
Return pointResult
End Function