ConvertFromVerticalPixels

View as Markdown

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.

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

ParameterDescription
xtarget
The vertical int coordinates in device pixels to convertThe PresenationSource representing the display surface used for the conversion. Note: For Charts, see ChartControl.PresentationSource.

Examples

1int applicationPixelY;
2
3protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
4{
5 // Obtain the application-pixel coordinate corresponding to a device-pixel Y value of 500
6 applicationPixelY = ChartingExtensions.ConvertFromVerticalPixels(500, ChartControl.PresentationSource);
7}