Point Explicit Conversion (Point to Vector)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a Vector structure with an X value equal to the point's X value and a Y value equal to the point's Y value.

Namespace:   System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)

public static explicit operator Vector (
	Point point
)

Parameters

point
Type: System.Windows.Point

The point to convert.

Return Value

Type: System.Windows.Vector

A vector with an X value equal to the point's X value and a Y value equal to the point's Y value.

The following example shows how to explicitly convert a Point into a 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;

}

.NET Framework
Available since 3.0
Return to top
Show: