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 / C++ / MFC
  4. Changing Screen Brightness/Colour/Contrast

Changing Screen Brightness/Colour/Contrast

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
9 Posts 4 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.
  • M Offline
    M Offline
    mcsherry
    wrote on last edited by
    #1

    Please can anyone tell me how to get and change the contrast/colour/brightness of the screen in C++/MFC. TIA, Andy

    D L 2 Replies Last reply
    0
    • M mcsherry

      Please can anyone tell me how to get and change the contrast/colour/brightness of the screen in C++/MFC. TIA, Andy

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      The first thing to figure out is how to do it without code. From there, you can start searching through a smaller set of APIs.


      "A good athlete is the result of a good and worthy opponent." - David Crow

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      M 1 Reply Last reply
      0
      • D David Crow

        The first thing to figure out is how to do it without code. From there, you can start searching through a smaller set of APIs.


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        M Offline
        M Offline
        mcsherry
        wrote on last edited by
        #3

        Hi, I'm not sure what your getting at, without code I'd just do: Display properties->Settings->Advanced->Color and change it there However searching for these just brings out code which changes the display settings for the app rather than the actual settings in windows. Andy,

        D 1 Reply Last reply
        0
        • M mcsherry

          Hi, I'm not sure what your getting at, without code I'd just do: Display properties->Settings->Advanced->Color and change it there However searching for these just brings out code which changes the display settings for the app rather than the actual settings in windows. Andy,

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          mcsherry wrote:

          I'm not sure what your getting at, without code I'd just do: Display properties->Settings->Advanced->Color and change it there

          That's exactly what I was getting at (which will become clearer in time). However, I have a Color Management tab, and on that tab I see nothing for screen brightness, color, or contrast. Do you have something different?


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          M 1 Reply Last reply
          0
          • D David Crow

            mcsherry wrote:

            I'm not sure what your getting at, without code I'd just do: Display properties->Settings->Advanced->Color and change it there

            That's exactly what I was getting at (which will become clearer in time). However, I have a Color Management tab, and on that tab I see nothing for screen brightness, color, or contrast. Do you have something different?


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            M Offline
            M Offline
            mcsherry
            wrote on last edited by
            #5

            In addition to the Colour Management tab I have a Colour tab which allows me to manually change the settings. ok so far I've tried:

            CDC *win = GetDesktopWindow()->GetDC() ;
            COLORADJUSTMENT col_adj ;

            win->GetColorAdjustment ( &col_adj ) ;

            col_adj.caBrightness = 100 ;
            int err = win->SetColorAdjustment ( &col_adj ) ;

            this does return the correct settings for the system however the Set method doesn't actually change anything *that I can see* so I'm assuming I'm looking at the wrong area and changing the wrong settings

            D 1 Reply Last reply
            0
            • M mcsherry

              In addition to the Colour Management tab I have a Colour tab which allows me to manually change the settings. ok so far I've tried:

              CDC *win = GetDesktopWindow()->GetDC() ;
              COLORADJUSTMENT col_adj ;

              win->GetColorAdjustment ( &col_adj ) ;

              col_adj.caBrightness = 100 ;
              int err = win->SetColorAdjustment ( &col_adj ) ;

              this does return the correct settings for the system however the Set method doesn't actually change anything *that I can see* so I'm assuming I'm looking at the wrong area and changing the wrong settings

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              mcsherry wrote:

              In addition to the Colour Management tab I have a Colour tab...

              Since I cannot reproduce this, you'll need to find which registry keys are changed by the controls on the Color tab.


              "A good athlete is the result of a good and worthy opponent." - David Crow

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              L 1 Reply Last reply
              0
              • M mcsherry

                Please can anyone tell me how to get and change the contrast/colour/brightness of the screen in C++/MFC. TIA, Andy

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

                You can use GetDeviceGammaRamp() and SetDeviceGammaRamp() to change monitor brightness on videocards that support it. More information in the MSDN: http://msdn2.microsoft.com/en-us/library/ms536529.aspx[^] All you have to do is call GetDeviceGammaRamp() and iterate through all 256 WORDS and increment them. Higher values == higher brightness. -Randor (David Delaune)

                M 1 Reply Last reply
                0
                • L Lost User

                  You can use GetDeviceGammaRamp() and SetDeviceGammaRamp() to change monitor brightness on videocards that support it. More information in the MSDN: http://msdn2.microsoft.com/en-us/library/ms536529.aspx[^] All you have to do is call GetDeviceGammaRamp() and iterate through all 256 WORDS and increment them. Higher values == higher brightness. -Randor (David Delaune)

                  M Offline
                  M Offline
                  mcsherry
                  wrote on last edited by
                  #8

                  cheers, does what it says on the tin!!! :-D Andy,

                  1 Reply Last reply
                  0
                  • D David Crow

                    mcsherry wrote:

                    In addition to the Colour Management tab I have a Colour tab...

                    Since I cannot reproduce this, you'll need to find which registry keys are changed by the controls on the Color tab.


                    "A good athlete is the result of a good and worthy opponent." - David Crow

                    "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                    L Offline
                    L Offline
                    led mike
                    wrote on last edited by
                    #9

                    DavidCrow wrote:

                    Since I cannot reproduce this

                    Nor I. Could be driver provided for the specific monitor (video card DUH :doh:).

                    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