> 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.

# ConvertFromVerticalPixels

## Definition

Converts a y-axis pixel coordinate from device pixels to application pixels.

For more information concerning the differences between application pixels and device pixels, please see the [Working with Pixel Coordinates](/developer/desktop-sdk/guides/educational-resources/working-with-pixel-coordinates).

## Method Return Value

A double representing a y-coordinate value in terms of application pixels.

## Syntax

`ChartingExtensions.ConvertFromVerticalPixels(this int x, PresentationSource target)`

`\<int\>.ConvertFromVerticalPixels(PresentationSource target)`

## Parameters

| Parameter                                                | Description                                                                                                                                                                                                                                                                                                               |
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| x                                                        | target                                                                                                                                                                                                                                                                                                                    |
| The vertical int coordinates in device pixels to convert | The [PresenationSource](https://msdn.microsoft.com/en-us/library/system.windows.presentationsource\(v=vs.110\).aspx) representing the display surface used for the conversion.  Note: For Charts, see [ChartControl.PresentationSource](/developer/desktop-sdk/references/common/charts/chartcontrol/presentationsource). |

## Examples

```csharp
int applicationPixelY;

protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
    // Obtain the application-pixel coordinate corresponding to a device-pixel Y value of 500
    applicationPixelY = ChartingExtensions.ConvertFromVerticalPixels(500, ChartControl.PresentationSource);
}
```