Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pixel Calculations
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00159459
Message ID:
00159622
Views:
23
>Does anyone know how the pixels are calculated in the report designer?
>
>If I create a new report with the scale unit set to pixels, drop a field onto my report, then save the report and open up the .frx file the VPOS is something like 33437.500 and the HPOS is 15104.167
>
>If I create a form and do the same thing, the TOP property is like 25 and the LEFT property is 30.
>
>What I am trying to accomplish is to take a simple report form (no data groupings, headers, footers, etc.) and scan through the .frx file getting the field positions and then creating a form object and adding textbox objects in the same position on the form as they are on the report.
>
>There seems to be some pixel calculation factor taking place that I just can't seem to figure out.
>
>Any help would be appreciated!

Hi Henry,

In addition to what my good friend David said, here's a bit of code that'll help you translate the pixels to inches.
DECLARE INTEGER GetDesktopWindow in Win32api
DECLARE INTEGER GetDC in Win32api;
  INTEGER hWnd
DECLARE INTEGER GetDeviceCaps IN Win32API;
  INTEGER hdc, INTEGER nIndex
DECLARE INTEGER ReleaseDC IN Win32Api;
  INTEGER lnhWnd, INTEGER hdc
lnhWnd = GetDesktopWindow()
lnhDC = GetDC(lnhWnd)
* Get the horizontal pixels per inch
lnxpixinch = GetDeviceCaps(lnhDC, 88)
* Get the vertical pixels per inch
lnypixinch = GetDeviceCaps(lnhDC, 90)
* Release the device context
= ReleaseDC(lnhWnd, lnhDC)
hth,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform