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. Contrast settings

Contrast settings

Scheduled Pinned Locked Moved C#
question
5 Posts 3 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.
  • A Offline
    A Offline
    abcurl
    wrote on last edited by
    #1

    Can we change the contrast settings programaticaly? I mean, after changing, the impact can be seen in the monitor menu of contrast figure .

    P 1 Reply Last reply
    0
    • A abcurl

      Can we change the contrast settings programaticaly? I mean, after changing, the impact can be seen in the monitor menu of contrast figure .

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You can in Vista or higher by p/invoking the SetMonitorContrast function. Alternatively, you can use the method listed here[^].

      I'm not a stalker, I just know things. Oh by the way, you're out of milk.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      A 1 Reply Last reply
      0
      • P Pete OHanlon

        You can in Vista or higher by p/invoking the SetMonitorContrast function. Alternatively, you can use the method listed here[^].

        I'm not a stalker, I just know things. Oh by the way, you're out of milk.

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        A Offline
        A Offline
        abcurl
        wrote on last edited by
        #3

        Alternative is associated with Brightness. Please correct me if I am misunderstanding it. I was looking for some sample code to change contrast. Can you please provide some piece of code associated with SetMonitorContrast function

        D P 2 Replies Last reply
        0
        • A abcurl

          Alternative is associated with Brightness. Please correct me if I am misunderstanding it. I was looking for some sample code to change contrast. Can you please provide some piece of code associated with SetMonitorContrast function

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          No sample code but P/Invoke isn't generally particularly difficult. The SetMonitorContrast API function is here[^]. It appears that you will need to use other functions too so the whole Monitor Configuration Functions[^] section may be of interest. For converting the C/C++ code to C# methods there are plenty of resources around, Luc has a good article on his blog and there is the interop toolkit which is a free download that does it all for you (no fun that way but useful if you don't like to get your hands dirty!).

          Dave
          Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

          1 Reply Last reply
          0
          • A abcurl

            Alternative is associated with Brightness. Please correct me if I am misunderstanding it. I was looking for some sample code to change contrast. Can you please provide some piece of code associated with SetMonitorContrast function

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            abcurl wrote:

            Can you please provide some piece of code associated with SetMonitorContrast function

            Is Google broken there? I told you the exact API to search for - how hard can the rest be?

            I'm not a stalker, I just know things. Oh by the way, you're out of milk.

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Onyx

            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