Vector.Explicit Vector.Explicit Vector.Explicit Operator

定義

オーバーロード

Explicit(Vector to Point) Explicit(Vector to Point) Explicit(Vector to Point)

このベクターの Point および X の値を持つ Y を作成します。Creates a Point with the X and Y values of this vector.

Explicit(Vector to Size) Explicit(Vector to Size) Explicit(Vector to Size)

このベクターのオフセットから Size を作成します。Creates a Size from the offsets of this vector.

Explicit(Vector to Point) Explicit(Vector to Point) Explicit(Vector to Point)

このベクターの Point および X の値を持つ Y を作成します。Creates a Point with the X and Y values of this vector.

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

パラメーター

vector
Vector Vector Vector

変換するベクター。The vector to convert.

戻り値

vectorX および Y のオフセット値と等しい X および Y の座標値を持つポイント。A point with X- and Y-coordinate values equal to the X and Y offset values of vector.

次の例は、変換する方法を示します、Vectorに、Pointします。The following example shows how to convert a Vector into a 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

Explicit(Vector to Size) Explicit(Vector to Size) Explicit(Vector to Size)

このベクターのオフセットから Size を作成します。Creates a Size from the offsets of this vector.

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

パラメーター

vector
Vector Vector Vector

変換するベクター。The vector to convert.

戻り値

このベクターの Size プロパティの絶対値と等しい Width と、このベクターの X プロパティの絶対値と等しい Height を持つ YA Size with a Width equal to the absolute value of this vector's X property and a Height equal to the absolute value of this vector's Y property.

次の例は、明示的に変換する方法を示します、Vectorに、Sizeします。The following example shows how to explicitly convert a Vector into a 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

適用対象