Results 1 to 7 of 7

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

  1. #1
    Constant Bitrate
    Join Date
    Sep 2006
    Location
    Cornwall, England
    Posts
    161

    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. #2
    Newbie
    Join Date
    Apr 2008
    Location
    Baghdad, Iraq/Fort Bragg, NC/Saginaw, MI
    Posts
    27
    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

  3. #3
    Constant Bitrate
    Join Date
    Sep 2006
    Location
    Cornwall, England
    Posts
    161
    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!)

  4. #4
    Newbie
    Join Date
    Apr 2008
    Location
    Baghdad, Iraq/Fort Bragg, NC/Saginaw, MI
    Posts
    27
    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

  5. #5
    Constant Bitrate
    Join Date
    Sep 2006
    Location
    Cornwall, England
    Posts
    161
    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!)

  6. #6
    Newbie
    Join Date
    Jun 2008
    Posts
    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

  7. #7
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    706
    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

Similar Threads

  1. New Frontend for Windows and Linux
    By gbr in forum Other Cool Front Ends
    Replies: 68
    Last Post: 01-21-2009, 08:55 PM
  2. Vista experiences anyone?
    By Nomader in forum Road Runner
    Replies: 80
    Last Post: 01-10-2008, 08:01 PM
  3. Installing Windows 2000 Pro on a 1GB Microdrive
    By JeremyM in forum WinNT Based
    Replies: 2
    Last Post: 05-07-2005, 09:56 PM
  4. Windows Freeze When Crank, Crank again windows unfreeze
    By antimatter in forum Power Supplies
    Replies: 37
    Last Post: 07-27-2004, 12:40 AM
  5. Windows ME and MediaCar
    By dug1967 in forum MediaCar
    Replies: 15
    Last Post: 04-15-2004, 01:30 PM

Bookmarks

Posting Permissions

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