Пример #1
0
        public void BrightnessDown()
        {
            int currentValue = WindowsBrightness.GetBrightness();

            byte[] levels = WindowsBrightness.GetBrightnessLevels();
            for (int i = levels.Length - 1; i > 0; i--)
            {
                if (currentValue > levels[i])
                {
                    WindowsBrightness.SetBrightness(levels[i]);
                    break;
                }
            }
        }
Пример #2
0
        public void BrightnessUp()
        {
            int currentValue = WindowsBrightness.GetBrightness();

            byte[] levels = WindowsBrightness.GetBrightnessLevels();
            for (int i = 0; i < levels.Length; i++)
            {
                if (levels[i] > currentValue)
                {
                    WindowsBrightness.SetBrightness(levels[i]);
                    break;
                }
            }
        }