Adjust screen brightness using C#

c#

Solution

Look at the SetDeviceGammaRamp API function. There's a CodeProject article that describes using it from C# here: Setting Screen Brightness in C#

Be aware that your graphics card has to support this though, I'd assume that most modern ones do, but I don't know.

Edit: Since the CodeProject article seems to be down, another place to find out how to call it from C# is on the pInvoke site.

Problem

How do I adjust the screen brightness in C#?

Original source