Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivalent Code
Message
From
25/05/2001 03:21:57
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00511306
Message ID:
00511363
Views:
18
>Hi Folks!
>
>What is the equivalent code of Visual Basic screen properties "screen.TwipsPerPixelY" to Visual Foxpro.
>
>Thanks in advance...

Ismael,
I think this is same - 1440/fontmetric(20).
However I use :
#Define cnLOG_PIXELS_X 88
#Define cnLOG_PIXELS_Y 90
#Define cnTWIPS_PER_INCH 1440
Declare integer GetActiveWindow in WIN32API
Declare integer GetDC in WIN32API integer iHDC
Declare integer GetDeviceCaps in WIN32API integer iHDC, integer iIndex

* Get a device context for VFP.
liHWnd = GetActiveWindow()
liHDC = GetDC(liHWnd)

* Get the pixels per inch.
liPixelsPerInchX = GetDeviceCaps(liHDC, cnLOG_PIXELS_X)
liPixelsPerInchY = GetDeviceCaps(liHDC, cnLOG_PIXELS_Y)

* Get the twips per pixel.
lnTwipsX=( cnTWIPS_PER_INCH / liPixelsPerInchX )
lnTwipsY=( cnTWIPS_PER_INCH / liPixelsPerInchY )
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform