Exemplo n.º 1
0
 public void SetBrightness(int targetBrightness)
 {
     if (targetBrightness < 0 || targetBrightness > 100)
     {
         PackageHost.WriteError("Invalid value !");
     }
     else
     {
         WindowsBrightness.SetBrightness((byte)targetBrightness);
     }
 }
Exemplo n.º 2
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;
                }
            }
        }
Exemplo n.º 3
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;
                }
            }
        }