Page 1 of 1

conversion: pixel -> base units

Posted: Wed Oct 06, 2004 4:48 am
by eddy
Code updated For 5.20+

Code: Select all

; =============
; usefull to make modal dialogbox
; =============

Procedure Pixel2BaseUnits(*pt.POINT)
   baseunit=GetDialogBaseUnits_()
   baseunitX=PeekW(@baseunit)
   baseunitY=PeekW(@baseunit+2)
   *pt\x=(*pt\x)*4/baseunitX
   *pt\y=(*pt\y)*8/baseunitY
EndProcedure 

Code: Select all

pt.POINT
pt\x=100
pt\y=200

Pixel2BaseUnits(@pt)

Debug pt\x
Debug pt\y