Announcement

Collapse
No announcement yet.

How do you adjust Windows Gamma/Brightness in VB.net?

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

  • How do you adjust Windows Gamma/Brightness in VB.net?

    I have a fully working front-end which I have coded. But obviously there is always room for improvement. I want to be able to have a 'night mode' which will adjust the Windows Gamma or brightness to dim the screen at night. What is the easiest way of doing this with VB.NET? I have searched everywhere, but couldn't find anything.

    Thanks
    ViVE - Volkswagen In Van Entertainment:

    VoomPC 2, VIA C7 2GHz
    7" Lilliput
    120Gb Sata drive
    1GB RAM


    [||||||||||] 100% - Planning
    [||||||||||] 100% - Software coding
    [||||||||||] 100% - Built

    (Always tweaking!)

  • #2
    personally, I used a light sensor, mounted next to the little red blinky light for my security system, and hacked the lcd case open, and just use the light sensor as a variable resistor for the LCD backlight power line..

    I would NOT seguest doing this if your not farmilure with electronics; but in my situation, it worked out rather well... at daybreak, the sunload/light sensor sits at 0 ohms resistance, and at night, it goes up to 10k ohms.

    But, back to your question:
    SendMessage is what your looking for; SetDeviceGammaRamp() is your golden egg =)

    Option 2, which is a bit messy for actual workstations, but should work fine in a carputer, is DeviceIoControl():
    http://www.dreamincode.net/forums/bl...?showentry=596

    This link gives a great walkthrough on how to use it properly; only catch, is when it fails it tends to set the gamma to 0, making the screen VERY dark (remember to SAVE your work before testing) a reboot will cure the blacked screen =D

    The software solutions will NOT control the LCD backlight, which leaves alot of ambient light in the car at night; which is why I went for a hardware solution.

    peace
    Mike

    Comment


    • #3
      Hi Conjur,

      I'm an electrical engineer by trade and do a lot of electronics work aswell, using an LDR is an excellent way of adjusting the screen brightness. Great idea!

      So, did you set the brightness to full and then let the light dependent resistor simply limit the current to the backlight?

      With 10K ohms of resistance, does the screen have any backlight at all?

      I've had a quick look on the internet on the Radio Spares website rswww.com but the only LDR's they have are something like 5.5K - 1000K, this would be way too much resistance, don't really want to have to use one of these attatched to transistors, your way seems very simple, I'll have to keep looking.
      ViVE - Volkswagen In Van Entertainment:

      VoomPC 2, VIA C7 2GHz
      7" Lilliput
      120Gb Sata drive
      1GB RAM


      [||||||||||] 100% - Planning
      [||||||||||] 100% - Software coding
      [||||||||||] 100% - Built

      (Always tweaking!)

      Comment


      • #4
        at 10k, there is just enough backlight that seeps through, to be able to make out what is on the screen when its completely dark
        and yes, I leave the backlight brightness at max, and let the sensor limit the voltage to it.
        I've only been running it for a short time now, and I'm not sure about the long-term effects on the backlight.

        Also, its not a 100% simple solution, as I'm not a very strong solderer, I have a couple of crappy connections that lead to occasional flickering.. I've been tempted to add a cap to clear up the flickering tho... it would make the transitions a bit smoother when going under steet lights also =D

        also, on a side note- another issue- I have a 0-18v line, with a pot on it, but the max I can pull through the circuit would be about 400ma.... is there any "clean" way to "amp" the output, without risking pulling over 400ma? the output is going to a power hungry blower motor, that sucks upwards of 15 amps =/

        peace
        Mike

        Comment


        • #5
          With the motor, you cant simply add resistance in line with it to limit the current because the voltage that is 'dropped' accross the pot will obviously fry it. To control the speed of a motor you would need some sort of speed controller. You could use a 555 timer circuit which uses a pot as the input to tell it how many pulses to output and then feed this into some sort of power transistor.

          Have a look here, half way down the page,

          http://www.educypedia.be/electronics...torcontrol.htm

          loads of DC motor control stuff.

          It's not a straight forward thing!
          ViVE - Volkswagen In Van Entertainment:

          VoomPC 2, VIA C7 2GHz
          7" Lilliput
          120Gb Sata drive
          1GB RAM


          [||||||||||] 100% - Planning
          [||||||||||] 100% - Software coding
          [||||||||||] 100% - Built

          (Always tweaking!)

          Comment


          • #6
            i would use a silicon controlled rectifier to control the motor speed ..... this was done alot with dc motors before 3 phase motors and variable frequecy inverters became much cheaper. of course im speaking of a slightly larger scale.... but they work well in the small scale too.

            but you can get scr's a dime a dozen from places like digikey and mouser electronics

            the come in all kinds of different configurations

            Comment


            • #7
              you can control the gamma ramp through Win32API. google GetDeviceGammaRamp or check this thread I just put a bunch of example code into.
              http://www.mp3car.com/vbulletin/soft...-attached.html

              Comment

              Working...
              X