Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. get native resolution of LCD display

get native resolution of LCD display

Scheduled Pinned Locked Moved C#
c++question
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LordZoster
    wrote on last edited by
    #1

    hallo is it possible to fetch the actual native resolution or the resolution ratio of a LCD display attached to the system? Eg.: i'd want my application to adapt differently if the LCD display is a 4:3 or a 16:9, etc., independently from the Windows' resolution Thanks!

    W L E 3 Replies Last reply
    0
    • L LordZoster

      hallo is it possible to fetch the actual native resolution or the resolution ratio of a LCD display attached to the system? Eg.: i'd want my application to adapt differently if the LCD display is a 4:3 or a 16:9, etc., independently from the Windows' resolution Thanks!

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      You could use System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size.

      The need to optimize rises from a bad design.My articles[^]

      J L 2 Replies Last reply
      0
      • W Wendelius

        You could use System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size.

        The need to optimize rises from a bad design.My articles[^]

        J Offline
        J Offline
        Jon Rista
        wrote on last edited by
        #3

        That will get the bounds of the screen at its current resolution...but will it get the bounds of the screen at its native resolution? For example, if I have a 1920x1080 screen, but I am running it at 1600x1200...the ratio of 1600x1200 is a 4:3 ratio, but the screen itself is a 16:9 ratio. There is also the question of a screen with 1920x1200/2560x1600, which are both 16:10. I am not sure the .Bounds property will actually provide the right information.

        W 1 Reply Last reply
        0
        • J Jon Rista

          That will get the bounds of the screen at its current resolution...but will it get the bounds of the screen at its native resolution? For example, if I have a 1920x1080 screen, but I am running it at 1600x1200...the ratio of 1600x1200 is a 4:3 ratio, but the screen itself is a 16:9 ratio. There is also the question of a screen with 1920x1200/2560x1600, which are both 16:10. I am not sure the .Bounds property will actually provide the right information.

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          You're right, it seems that Bounds returns current resolution. If the client is Vista, then the maximum sizes should be found using WMI (http://msdn.microsoft.com/en-us/library/aa394535(VS.85).aspx[^]) but I'm not sure if older Windows versions have anything similar.

          The need to optimize rises from a bad design.My articles[^]

          1 Reply Last reply
          0
          • W Wendelius

            You could use System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size.

            The need to optimize rises from a bad design.My articles[^]

            L Offline
            L Offline
            LordZoster
            wrote on last edited by
            #5

            Thanks for the reply, but the method returns the Windows resolution. I'm looking for the *real* *physical* *native* resolution of the LCD display, the number of real pixels that the display is made of. Eg. i need to know if the display is a 1280x800 or a 1280x1024, independently from the screen resolution currently setted in Windows. I think that it is possible to read that value, since Windows itself can: actually, it does so the very first time you attach a different LCD display and Windows (XP) says "the screen now will be adjusted for a better visualization".

            W 1 Reply Last reply
            0
            • L LordZoster

              Thanks for the reply, but the method returns the Windows resolution. I'm looking for the *real* *physical* *native* resolution of the LCD display, the number of real pixels that the display is made of. Eg. i need to know if the display is a 1280x800 or a 1280x1024, independently from the screen resolution currently setted in Windows. I think that it is possible to read that value, since Windows itself can: actually, it does so the very first time you attach a different LCD display and Windows (XP) says "the screen now will be adjusted for a better visualization".

              W Offline
              W Offline
              Wendelius
              wrote on last edited by
              #6

              I'm not sure about it but I think that earlier Windows versions may not see the native resolution. The display driver used sees it, but that wold be driver specific. However did you notice the post I replied to Jon Rista? Vista has a new WMI class definition to get the maximum sizes.

              The need to optimize rises from a bad design.My articles[^]

              1 Reply Last reply
              0
              • L LordZoster

                hallo is it possible to fetch the actual native resolution or the resolution ratio of a LCD display attached to the system? Eg.: i'd want my application to adapt differently if the LCD display is a 4:3 or a 16:9, etc., independently from the Windows' resolution Thanks!

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                DirectX lets you enumerate valid display modes (see EnumDisplayModes[^]). Chances are that the highest one will be the native resolution - but I can't guarantee that.

                1 Reply Last reply
                0
                • L LordZoster

                  hallo is it possible to fetch the actual native resolution or the resolution ratio of a LCD display attached to the system? Eg.: i'd want my application to adapt differently if the LCD display is a 4:3 or a 16:9, etc., independently from the Windows' resolution Thanks!

                  E Offline
                  E Offline
                  Expert Coming
                  wrote on last edited by
                  #8

                  Why would you want it to adapt to the screen and not the resolution? It will look stretched/smashed if you try to do that...

                  The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

                  L 1 Reply Last reply
                  0
                  • E Expert Coming

                    Why would you want it to adapt to the screen and not the resolution? It will look stretched/smashed if you try to do that...

                    The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

                    L Offline
                    L Offline
                    LordZoster
                    wrote on last edited by
                    #9

                    This is the interesting point :) The user will not have access to Windows settings (mandatory design). If he would attach a non-4:3 LCD to the machine, and Windows shouldn't adapt automatically to the native resolution, I should instead. I agree that is a driver matter. Thanks for the replies.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups