Ralf Angeli <address@hidden> writes:
- cap = GetDeviceCaps (hdc, VERTSIZE);
+ height = round (GetDeviceCaps (hdc, VERTRES)
+ / GetDeviceCaps (hdc, LOGPIXELSY) * 25.4);
- cap = GetDeviceCaps (hdc, HORZSIZE);
+ width = round (GetDeviceCaps (hdc, HORZRES)
+ / GetDeviceCaps (hdc, LOGPIXELSX) * 25.4);
Do these get any more accurate if you move the multiplication to
before the division?
cap = round (25.4 * GetDeviceCaps (hdc, VERTRES)
/ GetDeviceCaps (hdc, LOGPIXELSY));
If so, it might be worth changing. Otherwise, the results look just as
broken as what we have now. You may have found two cases where the
results were closer, but it does not follow that they will always be
so if they are still wildly inaccurate.