Vector.Explicit 연산자

정의

벡터를 Size 또는 Point로 변환합니다.

오버로드

Explicit(Vector to Point)

이 벡터의 PointX 값을 사용하여 Y를 만듭니다.

Explicit(Vector to Size)

이 벡터의 오프셋을 사용하여 Size를 만듭니다.

Explicit(Vector to Point)

이 벡터의 PointX 값을 사용하여 Y를 만듭니다.

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

매개 변수

vector
Vector

변환할 벡터입니다.

반환

Point

XY 좌표 값이 vectorXY 오프셋 값과 같은 점입니다.

예제

다음 예제에서는 변환 하는 방법을 보여 줍니다는 VectorPoint합니다.

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

적용 대상

Explicit(Vector to Size)

이 벡터의 오프셋을 사용하여 Size를 만듭니다.

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

매개 변수

vector
Vector

변환할 벡터입니다.

반환

Size

Size가 이 벡터의 Width 속성의 절대값과 같고 X가 이 벡터의 Height 속성의 절대값과 같은 Y입니다.

예제

다음 예제에서는 명시적으로 변환 하는 방법을 보여 줍니다는 VectorSize합니다.

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

적용 대상