home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4713 < prev    next >
Encoding:
Text File  |  1993-01-07  |  3.6 KB  |  85 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. From: chris@chrism.demon.co.uk (Chris Marriott)
  3. Path: sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
  4. Subject: Re: how does Windows know the physical dimensions of my monit 
  5. Distribution: world
  6. References: <1993Jan7.001644.7600@emr1.emr.ca>
  7. Organization: None
  8. Reply-To: chris@chrism.demon.co.uk
  9. X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
  10. Lines: 70
  11. Date: Thu, 7 Jan 1993 19:26:47 +0000
  12. Message-ID: <726434807snz@chrism.demon.co.uk>
  13. Sender: usenet@demon.co.uk
  14.  
  15. In article <1993Jan7.001644.7600@emr1.emr.ca> jagrant@emr1.emr.ca writes:
  16.  
  17. >The docs say that the following:
  18. >        xsize=GetDeviceCaps(hdc,HORZSIZE);
  19. >        ysize=GetDeviceCaps(hdc,VERTSIZE);
  20. >returns the dimensions of the physical display (mm).
  21. >How does it know these values for monitors????
  22. >
  23. >First of all, who am I talking to when I call GetDeviceCaps?
  24. >The display driver?  Windows?
  25. >
  26.  
  27. You're talking to Windows.  Windows then asks the display driver.
  28.  
  29. >If I am talking to the display driver, does it return these values by:
  30. >    1. looking them up from a table in the driver
  31. >    2. asking the graphics card for the values
  32. >    3. computing them from the resolution of the card and the
  33. >       size of a single pixel.  If so, does it get the size of
  34. >       the pixel from:
  35. >          (a) a table in the driver
  36. >          (b) asking the graphics card for the values
  37. >
  38.  
  39. It gets the values from the device driver.  The device driver can get
  40. them by any method it chooses, although I've NEVER heard of a driver which
  41. asks the graphics card :)  The standard method is to assume a standard
  42. monitor size, and base the results on that.  Typically the assumption is
  43. that a 14" monitor is in use at 640x480, a 17" at 1024x768, and a 20" at
  44. 1280x1024.
  45.  
  46. >I have a VGA Wonder and a NEC 3D.  When I use ATI's VSETUP program, I
  47. >can tell it that I have a NEC 3D.  Presumably VSETUP has a table of monitor
  48. >dimensions and sets that in the card's config table.  The Windows driver
  49. >can then ask the *card* how big the monitor is.  But what if I hook up
  50. >another monitor that VSETUP doesn't know about?  What then?
  51. >
  52.  
  53. No - the reason the ATI setup program asks you about the monitor is so it
  54. knows the maximum scan rates the monitor will support - it's nothing to
  55. do with the physical *size* of the monitor.
  56.  
  57. >The size is returned correctly on my system, but
  58. >the values returned on a NEC 6G (*huge beast*) are incorrect (smaller
  59. >than they should be).  That system is running a #9 24-bit card
  60. >in 1280 X 1024 resolution.  When it was set up, there was no way to
  61. >tell the card which monitor was being used.
  62. >
  63. >I would appreciate it if somone who knows driver internals could
  64. >poke around in the DDK for an answer.
  65. >
  66. >-- 
  67. >John A. Grant                                           jagrant@emr1.emr.ca
  68. >Airborne Geophysics
  69. >Geological Survey of Canada, Ottawa
  70. >
  71.  
  72. As you'll have noticed, values returned for printers are exact.  If you have
  73. a program which requires exact sizes on the screen, you'll probably have
  74. to resort to have the values entered by the user.  After all, you can
  75. change the monitor image size quite drastically using the monitor's
  76. controls, normally, so the question of the "correct" size is meaningless.
  77. -- 
  78. --------------------------------------------------------------------------
  79. | Chris Marriott                           | chris@chrism.demon.co.uk    |
  80. | Warrington, UK                           | BIX: cmarriott              |
  81. | (Still awaiting inspiration              | CIX: cmarriott              |
  82. |  for a witty .sig .... )                 | CompuServe: 100113,1140     |
  83. --------------------------------------------------------------------------
  84.  
  85.