Datalogic .NET SDK

DisplaySetBkltBrightness (Method)

 

Syntax

 

   public static DisplayBrightness DisplaySetBkltBrightness(DisplayBrightness brightness);

 

 

Class                           : Device

Namespace                : Datalogic.API

Assembly                   : Datalogic.API.DLL

 

 

Description

Sets the brightness setting of the backlight.

 

 

Parameters Table

 

Type

Parameter

Description

[in]

DisplayBrightness

brightness

A Device.DisplayBrightness enumeration that specifies the brightness intensity to set.

 

 

 

 

[returns]

DisplayBrightness

 

The brightness of the backlight is returned on success.

[on error]

Device.DisplayBrightness.Error

 

 

 

 

Example

 

 private void cbBrightness_SelectedIndexChanged(object sender, System.EventArgs e)

 {

       // Store old index

       int oldIndex = (((int)Device.DisplayGetBkltBrightness())/5) - 1;

                   

       if(oldIndex != this.cbBrightness.SelectedIndex)

       {

         if(res == DialogResult.Yes)

         {

             if (Device.DisplaySetBkltBrightness(

                    (Device.DisplayBrightness)((this.cbBrightness.SelectedIndex + 1)*5)) == Device.DisplayBrightness.Error)

             {

                    // If there was a failure to set the brightness, go

                    // back to the old setting.

                    MessageBox.Show("Unable to change Brightness");

 

                    // Make sure our old index is valid (there could of been

                    // an error retrieving the display brightness.

                    this.cbBrightness.SelectedIndex = oldIndex;

             }

         }

       }

 }

 

 

 

 

See Also

Device.DisplayBrightness (Enum), Example #022.

 

Copyright © Datalogic ADC. All Right Reserved