CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2001
    Posts
    19

    [?] dpi resolution

    Hallo,
    I want to know the dpi resolution of the pc (control panel - screen): I see I can set large characters (120 dpi), small characters (96 dpi) or customize it.
    How can I know what's the actual dpi resolution?

    I tried with api enumdisplaysettings but I have not what I want.
    Any idea?

    an Italian programmer (so, pardon for my ugly English!)



  2. #2
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: [?] dpi resolution

    It's as easy as this:

    dpi = 1440/Screen.TwipsPerPixelX


  3. #3
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: [?] dpi resolution

    That will give you dots per logical inch, but the problem is that the operating system does not know how many inches across your monitor is so you cannot do better than that for dots per physical inch I'm afraid.

    HTH,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  4. #4
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: [?] dpi resolution

    Yes, for a printer, or other output device, a logical inch is exactly equal to the physical inch, but for the monitor, we should be contented with the logical inch. Because now, the physical inch depends upon the dimensions of the monitor, the resolution, and even on the width of the screen that you set with the knobs on the monitor.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured