Announcement

Collapse
No announcement yet.

Screen Sizes...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Screen Sizes...

    Hello,

    I have been looking through the GetDeviceCaps and other related
    API function to get the "REAL" DPI of my monitor. It seems as
    though LOGPIXELSX(Y) always returns 96 on all monitors regardless
    of what size they are (15",17",19"). PHYSICALWIDTH returns zero
    unless used with a printer, so...

    How can I get the "REAL" dots per inch value for my monitor and
    other monitors so that I can scale a preview picture properly to
    8.5" x 11". I have read through Charles Petzold's book and I have
    tried using SetMapMode but that doesn't give the right results
    either.



    ------------------
    Cheers

  • #2
    This information is not likely to be generally available. The machine would have to be configured for a specific monitor, rather than a generic display. The monitor information would have to include the actual display size, not the advertising lie. The monitor would need to report any user adjustments to the display height and width. Finally, of course, the current display resolution must be taken into account. Only this last item is liable to be easy to come by!

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment


    • #3
      For monitors it's necessary to test HORZSIZE & VERTSIZE (mm).
      Or I am wrong ?

      ------------------

      Comment


      • #4
        As Tom said, the fiqures returned by %HORZSIZE and %VERTSIZE have no particular bearing to the physical dimensions of the desktop area... I prefer to think of them as "notional" measurements.

        IIRC, Petzold discusses this "problem" in "Programming Windows" the section about drawing a ruler along the edge of a textbox.

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          Lance --
          About Win9x' jokes I know. (270*203 mm)
          But NT4/2000 returns on my PC enough reallistic values
          (320 * 240 mm; I have 17'', 15.6'' visible)
          Theoretically, Windows is able to return correct values, because it knows a model of monitor.



          ------------------

          Comment


          • #6
            If you unplug the 17" monitor and plug in a 21", 14" or an 8" monitor, will you expect HORZSIZE to alter automatically? In other words, you still have to reply on the accuracy of the set up of the PC, so the result is still only approximate at best, and completely out at worst!


            ------------------
            Lance
            PowerBASIC Support
            mailto:[email protected][email protected]</A>
            Lance
            mailto:[email protected]

            Comment

            Working...
            X