Point.Explicit Operatör

Tanım

bir Point öğesini veya Vectoröğesine Size dönüştürür.

Aşırı Yüklemeler

Explicit(Point to Vector)

Vector Nokta değerine eşit bir X değere ve noktanın X değerine eşit bir değere Y sahip bir Y yapı oluşturur.

Explicit(Point to Size)

Size Bu noktanın değerine eşit ve bu noktanın X değerine eşit Y bir Height yapı Width oluşturur.

Explicit(Point to Vector)

Vector Nokta değerine eşit bir X değere ve noktanın X değerine eşit bir değere Y sahip bir Y yapı oluşturur.

public:
 static explicit operator System::Windows::Vector(System::Windows::Point point);
public static explicit operator System.Windows.Vector (System.Windows.Point point);
static member op_Explicit : System.Windows.Point -> System.Windows.Vector
Public Shared Narrowing Operator CType (point As Point) As Vector

Parametreler

point
Point

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

Döndürülenler

Noktanın değerine eşit bir X değere ve noktanın X değerine eşit değere Y sahip bir Y vektör.

Örnekler

Aşağıdaki örnekte, açıkça bir Point öğesine nasıl dönüştürüldüğü gösterilmektedir Vector.

private Vector overloadedExplicitOperatorVectorExample()
{

    Point point1 = new Point(10, 5);

    // Explicitly converts a Point structure into a Vector structure.
    // returnVector is equal to (10,5).
    Vector returnVector = (Vector)point1;

    return returnVector;
}
Private Function overloadedExplicitOperatorVectorExample() As Vector

    Dim point1 As New Point(10, 5)

    ' Explicitly converts a Point structure into a Vector structure.
    ' returnVector is equal to (10,5).
    Dim returnVector As Vector = CType(point1, Vector)

    Return returnVector

End Function

Şunlara uygulanır

Explicit(Point to Size)

Size Bu noktanın değerine eşit ve bu noktanın X değerine eşit Y bir Height yapı Width oluşturur.

public:
 static explicit operator System::Windows::Size(System::Windows::Point point);
public static explicit operator System.Windows.Size (System.Windows.Point point);
static member op_Explicit : System.Windows.Point -> System.Windows.Size
Public Shared Narrowing Operator CType (point As Point) As Size

Parametreler

point
Point

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

Döndürülenler

Size Bu noktanın değerine eşit ve bu noktanın X değerine eşit Y olan bir Height yapıWidth.

Örnekler

Aşağıdaki örnekte, açıkça bir Point öğesine nasıl dönüştürüldüğü gösterilmektedir Size.

private Size overloadedExplicitOperatorSizeExample()
{

    Point point1 = new Point(10, 5);

    // Explicitly converts a Point structure into a Size structure.
    // returnSize has a width of 10 and a height of 5  
    Size returnSize = (Size)point1;

    return returnSize;
}
Private Function overloadedExplicitOperatorSizeExample() As Size

    Dim point1 As New Point(10, 5)

    ' Explicitly converts a Point structure into a Size structure.
    ' returnSize has a width of 10 and a height of 5  
    Dim returnSize As Size = CType(point1, Size)

    Return returnSize

End Function

Açıklamalar

Bir Size yapı negatif olamayacağından, noktanın X ve Y özelliklerinin mutlak değerleri kullanılır.

Şunlara uygulanır