DisplayManager.SetBrightness(Int32, Single, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the brightness of the specified display.
[Android.Runtime.Register("setBrightness", "(IFI)V", "", ApiSince=36)]
[Android.Runtime.RequiresPermission("android.permission.WRITE_SETTINGS")]
public void SetBrightness(int displayId, float value, int unit);
[<Android.Runtime.Register("setBrightness", "(IFI)V", "", ApiSince=36)>]
[<Android.Runtime.RequiresPermission("android.permission.WRITE_SETTINGS")>]
member this.SetBrightness : int * single * int -> unit
Parameters
- displayId
- Int32
The logical display ID
- value
- Single
The brightness value to set
- unit
- Int32
The unit of the brightness value. Value is one of the following: BRIGHTNESS_UNIT_PERCENTAGE; BRIGHTNESS_UNIT_RAW
- Attributes
Remarks
Sets the brightness of the specified display. Accepts different brightness units.
The brightness value, regardless of the unit, might be adjusted by the system to reflect the current system setting and constraints. Requires Manifest.permission.WRITE_SETTINGS
Android reference for android.hardware.display.DisplayManager.setBrightness.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.