Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am writing a Kinect program to interface with Windows using gestures. I would like to increase/decrease the brightness of the screen without having to use the properties window. Basically, I want to use gestures for this. I would also like to be able to control the volume in the same way.

I'm using Visual Studio 2012 (beta) and C#.
Posted
Updated 23-Apr-12 23:13pm
v2

1 solution

Hi,

the simple way to increase/decrease monitor "brightness" is to P/Invoke the Gamma-Value with SetDeviceGammaRamp function in GDI32.dll.
The reason why brightness is quoted is it's not really setting the real monitor brightness when changing gamma value, but it really looks like.
The disadvantage is compability to graphic cards, some graphic cards doesn't seem to allow this because of their architecture.

Function at Pinvoke.net
http://www.pinvoke.net/default.aspx/gdi32.setdevicegammaramp[^]

CP
Setting Screen Brightness in C#[^]

The safe way would be sending DDC(Display Data Channels)/CI-Commands (for VGA/DVI). But this is not a weekend task, so with a commercial library it could be done very quick ;) Both cases are overdriven for your pruposes (except you really want to spend money for this).

http://www.nicomsoft.com/products/i2c/[^]

Kinect SDK provides interfaces for audio, acoustic noise and echo cancellation.
Or do you want to control Windows Volume?

For XP, you could also P/Invoke winmm.dll waveoutsetvalue.
http://www.pinvoke.net/default.aspx/winmm.waveoutsetvolume[^]

Since Win7 audio api changed, in a few words, you should start with Windows Multimedia Device (MMDevice) API and search for audio endpoint devices.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd316556%28v=vs.85%29.aspx[^]

Naudio is a great easy-to-use library for this:
http://naudio.codeplex.com/[^]

Best Regards
 
Share this answer
 
v3
Comments
[no name] 24-Apr-12 21:40pm    
nice
El_Codero 25-Apr-12 2:57am    
thank you Wes ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900