wx.GetDisplaySize() return the monitor resolution OK but GetDisplaySizeMM() returns as height and widht as the monitor are in normal mode.
Windows XP SP2
wx 2.8.8.1 (msw-unicode)
···
--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.
On pc1, with normal monitor (1024x768 px), the map mode MM_METRIC runs fine, but in pc2 with rotated monitor (1050 x 1680 px) the image with map mode MM_METRIC appear deformed.
Please see the attached images.
Both systems with Windows XP SP2 and wx 2.8.8.1 (msw-unicode)
--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.
wx.GetDisplaySize() return the monitor resolution OK but
GetDisplaySizeMM() returns as height and widht as the monitor are in
normal mode.
The millimeter information comes straight from the graphics card. If
the graphics card lies, wxPython can't fix it.
The fact is that NOTHING inside Windows actually knows the physical size
of your monitor. The graphics driver gives an estimate based on
whatever the typical monitor was at the time the driver was developed,
but that's the best you can do. This is one area where Apple has always
done a better job than Microsoft.
The best advice is: never use GetDisplaySizeMM. It is fiction. If you
really need physical dimensions, then your application must display a
ruler and have the user calibrate it with a real-world ruler. It's not
that hard to do.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
On pc1, with normal monitor (1024x768 px), the map mode MM_METRIC runs
fine, but in pc2 with rotated monitor (1050 x 1680 px) the image with
map mode MM_METRIC appear deformed.
Please see the attached images.
Both systems with Windows XP SP2 and wx 2.8.8.1 (msw-unicode)
Bug?, DriverFail?
Driver bug. GDI computes the mapping mode transformations based on the
physical measurements from the display driver. If the driver lies, as
appears to be the case, then both wxPython and GDI will fall into its trap.
I have to admit I have not previously seen a discrepancy quite this bad,
but I have certainly seen similar problems before. The metric and
English mapping modes are not as useful as one would like on display cards.
Interestingly, printers almost always get this exactly right.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
On pc1, with normal monitor (1024x768 px), the map mode MM_METRIC runs
fine, but in pc2 with rotated monitor (1050 x 1680 px) the image with
map mode MM_METRIC appear deformed.
Please see the attached images.
Both systems with Windows XP SP2 and wx 2.8.8.1 (msw-unicode)
Bug?, DriverFail?
Driver bug. GDI computes the mapping mode transformations based on the
physical measurements from the display driver. If the driver lies, as
appears to be the case, then both wxPython and GDI will fall into its trap.
I have to admit I have not previously seen a discrepancy quite this bad,
but I have certainly seen similar problems before. The metric and
English mapping modes are not as useful as one would like on display cards.
Interestingly, printers almost always get this exactly right.
Thanks for your reply Tim.
I'm trying a method to calculate how many pixels are in a milimeter (screen or printer).
The use of wx.GetSizeMM() was for
pixels_in_milimeter = GetSize / GetSizeMM
But if it's not reliable I use:
pixels_in_milimeter = GetPPI / 25.397641488428423
Is there another method to do it?
···
--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.
I'm trying a method to calculate how many pixels are in a milimeter
(screen or printer).
The use of wx.GetSizeMM() was for
pixels_in_milimeter = GetSize / GetSizeMM
But if it's not reliable I use:
pixels_in_milimeter = GetPPI / 25.397641488428423
Is there another method to do it?
Printer drivers are usually very good about reporting the exact paper
size in millimeters, so the first code should work.
For the screen, there is simply no way to do this accurately. Your
second method is generally better, because that's information that
Windows maintains -- it doesn't rely on the driver. It isn't the
reality, but it's the same information Windows uses to determine the
default font sizes. Because it's not reality, there is no point in
carrying the constant to 15 decimal places. "25" is more than good enough.
You know that "millimeter" has two Ls, right? I hate spelling errors in
code...
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
You know that "millimeter" has two Ls, right? I hate spelling errors in
code...
Opps, a translation error. I'm not english native. In spanish is "milimetro" with only one 'l'.
Regards.
···
--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.
wx.GetDisplaySize() return the monitor resolution OK but GetDisplaySizeMM() returns as height and widht as the monitor are in normal mode.
Windows XP SP2
wx 2.8.8.1 (msw-unicode)
wx just calls the GetDeviceCaps win32 API function to get those values, so apparently either MS or the video driver is getting lost somewhere along the way.
if ( width )
*width = ::GetDeviceCaps(dc, HORZSIZE);
if ( height )
*height = ::GetDeviceCaps(dc, VERTSIZE);
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!