Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transform top into metric value.
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01265916
Message ID:
01266007
Views:
10
This message has been marked as the solution to the initial question of the thread.
You can use GetDeviceCaps() to get Pixels per Cm as shown below.
CLEAR 

#DEFINE LOGPIXELSX 88    && Logical pixels/inch in X         
#DEFINE LOGPIXELSY 90    && Logical pixels/inch in Y         

DECLARE INTEGER GetActiveWindow IN WIN32API
DECLARE INTEGER GetDC IN WIN32API INTEGER hDC
DECLARE INTEGER GetDeviceCaps IN WIN32API INTEGER hDC, INTEGER nIndex

* Active window handle
lnHwnd = GetActiveWindow()
* Device context
lnHDC = GetDC(lnHwnd)

* Pixels per Inch
lnPixelsPerInchX = GetDeviceCaps(lnHDC, LOGPIXELSX)
lnPixelsPerInchY = GetDeviceCaps(lnHDC, LOGPIXELSY)
* Pixels per cm
lnCmPerInc = 2.54
lnPixelsPerCmX = lnPixelsPerInchX / lnCmPerInc
lnPixelsPerCmY = lnPixelsPerInchY / lnCmPerInc

? lnPixelsPerCmX, lnPixelsPerCmY
>
>
>How transform "Top" or "left" Value into other value ( cm ) ?
>
>here for Top = 6 , i want 1,1 cm ...
>
>http://cjoint.com/data/lbxxfYMzm4.htm
>
>Thank in advance for help.
>
>
>bernhart
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform