Vector.Explicit Operatör

Tanım

Bir vektörün içine Size veya Pointdönüştürür.

Aşırı Yüklemeler

Explicit(Vector to Point)

Bu vektörünün X ve Y değerleriyle bir Point oluşturur.

Explicit(Vector to Size)

Bu vektörünün uzaklıklarından bir Size oluşturur.

Explicit(Vector to Point)

Bu vektörünün X ve Y değerleriyle bir Point oluşturur.

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

Parametreler

vector
Vector

Dönüştürülecek vektör.

Döndürülenler

Point

ve uzaklık değerlerine X eşit - ve YY -koordinat değerlerine sahip Xbir vectornokta.

Örnekler

Aşağıdaki örnekte, ' Vector nin 'a nasıl dönüştürüldüğü gösterilmektedir 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

Şunlara uygulanır

Explicit(Vector to Size)

Bu vektörünün uzaklıklarından bir Size oluşturur.

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

Parametreler

vector
Vector

Dönüştürülecek vektör.

Döndürülenler

Size

Size Width Bu vektör özelliğinin mutlak değerine eşit ve bu vektör X özelliğinin mutlak değerine Y eşit olan AHeight.

Örnekler

Aşağıdaki örnekte, açıkça ' Vector nin 'a nasıl dönüştürüldüğü gösterilmektedir 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

Şunlara uygulanır