Description
|
Allows a program to specify
scaling factors for subsequent calls to TBApiScaleCoordinates.
Typically used to map pointer co-ordinates to a window size. This should be
called if the window size or position changes. |
Parameters |
Scale
handle and initial window co-ordinates. |
Returns |
0 = fail, 1 = OK. |
Notes |
The handle should be -1 on the first
call. On subsequent calls for the same target the value returned from the
first call should be used. |
Visual C++ Declaration/example
BOOL TBAPI TBApiSetScaleDimensions(long* handle, unsigned long left, unsigned
long top, unsigned long right, unsigned long bottom);
//
// At window creation
//
long scaleHandle = -1;
TBApiSetScaleDimensions(&scaleHandle,l,t,r,b); // where l,t,r,b
represent the window initial co-ordinates
//
// Whenever window is moved or resized
//
TBApiSetScaleDimensions(&scaleHandle,l,t,r,b); // where l,t,r,b
represent the new window co-ordinates
//
// In data callback
//
unsigned short x,y;
TBApiScaleCoordinates(scaleHandle,data,&x,&y)
x,y now hold the co-ordinate values from data mapped to the target area
Public Declare Function
TBApiSetScaleDimensions Lib "TBapi" Alias
"_DLL_TBApiSetScaleDimensions@20" (ByVal handle As Long, ByVal left As
Long, ByVal top As Long, ByVal right As Long, ByVal bottom As Long) As Long