Cristobal
I adjusted the top / left values of < GETCURSORPOS() >
with a factor
1.25 -> 1920 x 1080 of 125 % zoom
linear with a factor
1.5 -> 1920 x 1080 of 150 % zoom
I tested all monitor areas with perfect results.
maybe we doen't need any complicted calculations and can work with a fixed factor ?
other resolution with a factor
1.25 -> 1600 x 900 of 125 % zoom works as well.
it means only 2 possible adjustments are needed : factor 1,25 for 125 % zoom and 1.5 if 150 % zoom is used.
I tested :
nZoom := GetScaleFactorForDevice( 0 )
MsgAlert( nZoom, "Zoom-factor" ) > returns 100 % ( 125 % is needed )
Is there maybe another function or calculation ?
Your function -> CalcZoom() also doesn't return 125 %
FUNCTION GETCOLOR()
local hDeskTop := GETDC(0)
local a := GETCURSORPOS()
// Left Top
local nColor := GETPIXEL( hDeskTop, a[2] *
1.25, a[1] *
1.25 )
local hDC := oDlgChild:GETDC()
local hPen := CREATEPEN( PS_SOLID, 1.5, CLR_HRED )
local hOldPen
local nTop, nLeft
local nWidth, nHeight
nTop := 5
nLeft := 5
nWidth := 90
nHeight := 90
MOVETO( hDC, nLeft-1, nTop-1)
LINETO( hDC, nLeft + nWidth+1, nTop-1 )
LINETO( hDC, nLeft + nWidth+1, nTop+nHeight+1 )
LINETO( hDC, nLeft -1, nTop+nHeight+1 )
LINETO( hDC, nLeft-1, nTop-1)
STRETCHBLT( hDC, nLeft, nTop, nWidth, nHeight, hDeskTop, ;
a[2] *
1.25 -(nWidth/(nZoom*2)), a[1] *
1.25 -(nHeight/(2*nZoom)), ;
nWidth/nZoom, nHeight/nZoom, 13369376 )
...
...
regards
Uwe