And for know zoom active
Code: Select all | Expand
#define LOGPIXELSX 88
#define LOGPIXELSY 90
#define ASPECTX 40
#define ASPECTY 42
#define ASPECTXY 44
//----------------------------------------------------------------------------//
Function GetLogPixels()
local hDCM := oMWnd:GetDC()
? GetDeviceCaps( hDCM, LOGPIXELSX ), GetDeviceCaps( hDCM, LOGPIXELSY ), ;
GetDeviceCaps( hDCM, ASPECTX ), GetDeviceCaps( hDCM, ASPECTY )
? GetScaleFactorForDevice( 0 )
oMWnd:ReleaseDC()
Return nil
//----------------------------------------------------------------------------//
DLL32 FUNCTION GetScaleFactorForDevice( deviceType AS DWORD ) AS LONG PASCAL LIB "Shcore.dll"
//----------------------------------------------------------------------------//
And I do not know if this function performs the coordinate conversion correctly
Code: Select all | Expand
//----------------------------------------------------------------------------//
Function AdjustPos( aPoint )
Local nZoom := GetScaleFactorForDevice( 0 )
Local nPorc := nZoom / 96
aPoint[ 1 ] := Round( aPoint[ 1 ] / nPorc, 0 )
aPoint[ 2 ] := Round( aPoint[ 2 ] / nPorc, 0 )
Return aPoint
//----------------------------------------------------------------------------//