ConvertFromVerticalPixels

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Common > Charts > ChartingExtensions >

ConvertFromVerticalPixels

Previous page Return to chapter overview Next page

Definition

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

 

Note:  For more information concerning the differences between application pixels and device pixels, please see the Working with Pixel Coordinates educational resource.

 

 

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)

 

x

The vertical int coordinates in device pixels to convert

target

The PresenationSource representing the display surface used for the conversion

 

Note:  For Charts, see ChartControl.PresentationSource

 

 

Example

ns


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);
}