emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display-mm-width return value off on Windows


From: Lennart Borgman
Subject: Re: display-mm-width return value off on Windows
Date: Fri, 07 Jul 2006 00:37:08 +0200
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

Jason Rumney wrote:
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.
MS documentation for GetDeviceCaps says:

   HORZSIZE     Width, in millimeters, of the physical screen.
   VERTSIZE     Height, in millimeters, of the physical screen.

Should we really try to compensate for bugs in device drivers?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]