Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to convert pixels to inches/cm?
Message
From
21/08/2006 21:51:38
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
21/08/2006 20:04:22
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01147454
Message ID:
01147465
Views:
17
>Hi,
>
>I have a grid on a form. I'd like to be able to generate a report based on the information shown in the columns while preserving the grid column order and widths. I've created reports on the fly at runtime that work except for the fact that I cannot reliably determine what the column widths are (in inches) for the report.
>
>Does anyone know how I can convert the grid's column width from pixels to inches?
>
>TIA
>
>Mike

This information is really quite variable. One pixel is one point on the screen. The same pixel will be wider if you have a lower resoution, and vice-versa.

So, for instance, with a resolution of 800 x 600, 1 pixel is 1/800 of the screen width. You will have to multiply that factor by the actual screen size - this again will be quite different; the user might have a 14", a 17", or a 21" screen, among others. The width, by the way, is the diagonal of the monitor, and it includes the borders where no information is being shown. So, it is best to take your measuring rod and measure the width of a common form.

By the way, one inch is 2.54 cm.

In summary, the units (pixels versus cm.) are really quite incompatible.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform