Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transform top into metric value.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01265916
Message ID:
01266007
Vues:
11
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform