Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to position text
Message
From
03/06/2004 04:08:39
 
 
To
02/06/2004 14:32:36
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00909351
Message ID:
00909484
Views:
10
Hi,

>>
I need to insert spaces between the words to align them, but I can't find any function that will give me the real length in inches of a given text. TXTWIDTH and FONTMETRIC works in pixels. Any function to convert from pixels to inches?
>>

The number of pixels per inch depends on the device that will display/print the field (presumably you will be doing this at some point - otherwise why format the text ?)

The basic API is:
DECLARE Integer GetDeviceCaps IN WIN32API Integer iHDC, Integer Index
liPixelsPerInchX = GetDeviceCaps(liDeviceHandle,88)
liPixelsPerInchY = GetDeviceCaps(liDeviceHandle,90)
where liDeviceHandle is the Window or Printer handle for the output. Needless to say if the text will be displayed on different devices there's no point in formating the field...

HTH,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform