> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# ToVector2()

## Definition

Converts a **System.Windows.Point** structure to a **SharpDX.Vector2** when [Using SharpDX for Custom Chart Rendering](/developer/desktop-sdk/guides/educational-resources/using-sharpdx-for-custom-chart-rendering).

## Method Return Value

A new **SharpDX.Vector2** constructed with the point parameters X and Y values.

## Syntax

`DxExtensions.ToVector2(this System.Windows.Point point)`

`\<point\>.ToVector2()`

## Parameters

| Parameter | Description                                                                                                                 |
| --------- | --------------------------------------------------------------------------------------------------------------------------- |
| point     | The [System.Windows.Point](https://msdn.microsoft.com/en-us/library/system.windows.point\(v=vs.110\).aspx) point to convert |

## Examples

```csharp
// gets the application/user WPF point and converts to a SharpDX Vector 
System.Windows.Point wpfPoint = ChartControl.MouseDownPoint;

SharpDX.Vector2 dxVector2 = wpfPoint.ToVector2();
```