TiObjectCanvas.GetPixelsXToDisplayX
TiObjectCanvas See Also
Used to convert an X-coordinate pixel value to an X-coordinate display value
on the Object Canvas.
function GetPixelsXToDisplayX(Value : Integer) : Double;
Description
Call the GetPixelsXToDisplayX method to convert an upper left-hand corner 0,0
origin X-coordinate pixel value to a Cartesian X-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 a Y coordinate pixel value, see GetPixelsYToDisplayY.
Example
Delphi
Value := iComponent.GetPixelsXToDisplayX(1000);
iComponent.SetObjectPositionX(iComponent.GetPixelsXToDisplayX(1000));
C++ Builder
Value = iComponent->GetPixelsXToDisplayX(1000);
iComponent->SetObjectPositionX(iComponent->GetPixelsXToDisplayX(1000));
Contents | Index | Previous | Next