Vector.Explicit 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
| Nom | Description |
|---|---|
| Explicit(Vector to Point) |
Crée un Point avec les valeurs et X les Y valeurs de ce vecteur. |
| Explicit(Vector to Size) |
Crée un Size à partir des décalages de ce vecteur. |
Explicit(Vector to Point)
public:
static explicit operator System::Windows::Point(System::Windows::Vector vector);
public static explicit operator System.Windows.Point(System.Windows.Vector vector);
static member op_Explicit : System.Windows.Vector -> System.Windows.Point
Public Shared Narrowing Operator CType (vector As Vector) As Point
Paramètres
- vector
- Vector
Vecteur à convertir.
Retours
Point avec - et X-coordonnée valeurs égales aux Y valeurs de X décalage et de Y.vector
Exemples
L’exemple suivant montre comment convertir un Vector en un Point.
private Point overloadedExplicitOperatorExample2()
{
Vector vector1 = new Vector(20, 30);
// Explicitly converts a Vector structure into a Point structure.
// returnPoint is equal to (20, 30).
Point returnPoint = (Point)vector1;
return returnPoint;
}
Private Function overloadedExplicitOperatorExample2() As Point
Dim vector1 As New Vector(20, 30)
' Explicitly converts a Vector structure into a Point structure.
' returnPoint is equal to (20, 30).
Dim returnPoint As Point = CType(vector1, Point)
Return returnPoint
End Function
S’applique à
Explicit(Vector to Size)
Crée un Size à partir des décalages de ce vecteur.
public:
static explicit operator System::Windows::Size(System::Windows::Vector vector);
public static explicit operator System.Windows.Size(System.Windows.Vector vector);
static member op_Explicit : System.Windows.Vector -> System.Windows.Size
Public Shared Narrowing Operator CType (vector As Vector) As Size
Paramètres
- vector
- Vector
Vecteur à convertir.
Retours
Size Égal Width à la valeur absolue de la propriété de X ce vecteur et Height égale à la valeur absolue de la propriété de Y ce vecteur.
Exemples
L’exemple suivant montre comment convertir explicitement un Vector en un Size.
private Size overloadedExplicitOperatorExample1()
{
Vector vector1 = new Vector(20, 30);
// Explicitly converts a Vector structure into a Size structure.
// returnSize has a width of 20 and a height of 30.
Size returnSize = (Size)vector1;
return returnSize;
}
Private Function overloadedExplicitOperatorExample1() As Size
Dim vector1 As New Vector(20, 30)
' Explicitly converts a Vector structure into a Size structure.
' returnSize has a width of 20 and a height of 30.
Dim returnSize As Size = CType(vector1, Size)
Return returnSize
End Function