Adjust screen brightness using C#

前端 未结 6 1592
面向向阳花
面向向阳花 2020-12-01 11:13

How do I adjust the screen brightness in C#?

6条回答
  •  忘掉有多难
    2020-12-01 11:46

    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.

提交回复
热议问题