TiObjectCanvas.GetPixelsYToDisplayY

TiObjectCanvas See Also

Used to convert an Y-coordinate pixel value to an Y-coordinate display value on the Object Canvas.

function GetPixelsYToDisplayY(Value : Integer) : Double;

Description

Call the GetPixelsYToDisplayY method to convert an upper left-hand corner 0,0 origin Y-coordinate pixel value to a Cartesian Y-coordinate display value on the Object Canvas. Since the Object canvas uses the Cartesian coordinate system (where the default 0,0 origin is in the center of the component), this function provides a way to convert between the upper-left-hand corner 0,0 pixel origin that the Windows API and QT API use and the center 0,0 origin of the Object Canvas Component.

Note: Basically this function converts pixel values that you would get from other functions in windows to the coordinate Cartesian Coordinate system of the component. If you are using the OnMouseDown, OnMouseClick, OnMouseUp, or OnMouseMove events, take a look at our replacement events (see the See Also Link Above) that automatically call this function and convert the mouse clicks to Cartesian Coordinates for you. If you need to convert an X coordinate pixel value, see GetPixelsXToDisplayX.

Example

Delphi

Value := iComponent.GetPixelsYToDisplayY(1000);

C++ Builder

Value = iComponent->GetPixelsYToDisplayY(1000);

Contents | Index | Previous | Next