Getting PHYSICAL monitor size in C#

From: Valerie Hough (support_at_hcs-usa.com)
Date: 02/13/04


Date: Fri, 13 Feb 2004 18:37:33 -0500

Does anyone have an example of how to get the PHYSICAL monitor size in C#?

In C++ I used to use GetDeviceCaps( dc, HORZSIZE ) which returns the monitor
size in mm, then I
converted it to inches.

When I do this as unmanaged code in C#, I am getting back a value that show
my 19" monitor
has a width of only 12.9", whereas my trusty ruler shows it to be about
15.5".

Is this a driver problem, and if so, what am I to do?

Thanks in advance,
Chris Hough



Relevant Pages

  • Re: DPI and horizontal and vertical directions
    ... Horiz and Vert directions be different? ... (When I test on my monitor and printer, ... GetDeviceCaps() is returning the same value ... for both HORZRES and VERTRES parameters. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Getting the physical DPI of the screen
    ... HORZSIZE is consistently inaccurate. ... The first two device capabilities, HORZSIZE and VERTSIZE, are documented ... "Width, in millimeters, of the physical screen" and "Height, in ... Windows really know the monitor size? ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Screen Size
    ... After listing the output of his 21" monitor as 320 ... HORZSIZE = 25.4 * HORZRES/LOGPIXELSX ... Under Windows 9x, the values would be correct, ... I do of course know that the LOGPIXELSX result (which is pixels per ...
    (microsoft.public.vb.general.discussion)
  • Re: Getting the physical DPI of the screen
    ... HORZSIZE is consistently inaccurate. ... The first two device capabilities, HORZSIZE and VERTSIZE, are documented as ... "Width, in millimeters, of the physical screen" and "Height, in millimeters, ... Windows really know the monitor size? ...
    (microsoft.public.win32.programmer.gdi)