`

How to set the brightness

 
阅读更多
android.provider.Settings.System.putInt(getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, brightness); // 0-255 
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = brightness / 255.0f;
getWindow().setAttributes(lp);

 另外需要延迟关闭应用,大概需要延迟几百毫秒吧~

分享到:
评论

相关推荐

    Get/Set brightness throught DeviceIOCtrl.zip

    标题 "Get/Set brightness throught DeviceIOCtrl.zip" 涉及到的是在Windows系统中通过设备控制函数(DeviceIoControl)来调整屏幕亮度的技术。这是一个常见的需求,特别是在开发系统级应用或者驱动程序时,需要对...

    Android代码-Brightness

    Brightness Android app widget A very simple app widget for the Android home screen. Clicking the widget toggles between automatic and... but clicking the widget will switch to "Auto" as if it was off.

    auto_enhance.zip_BRIGHTNESS LEVELS_The Image_color enhance

    AUTOENHANCE Automatically adjusts/enhances the image(brightness, color and contrast) to "optimum" levels.

    MlSkin 4.3 Delphi 10.3

    Easy to achieve the shadow of the form, the shape of the special form effect, simple to only need to set up two pictures. You can add any number of pictures, buttons and text on the form title bar. ...

    brightness

    ### 图像亮度调整技术 #### 一、简介 在图像处理领域中,调整图像的亮度是一种常见的需求。本文将详细介绍如何使用C语言实现对彩色图像亮度的调整。具体来说,我们将探讨一种简单的方法来增加图像的亮度,通过直接...

    VIsta Brightness Control

    - **DXGKMDT_MODESET_BRIGHTNESS_INTERFACE**:这是一个必需的接口,用于向操作系统报告当前的亮度级别并接受来自操作系统的亮度设置请求。 - **DXGKCB_SETDISPLAYBRIGHTNESS**:这是驱动程序必须实现的一个函数,...

    Node.js-brightness-改变屏幕的亮度

    在实际使用中,用户可以通过命令行界面输入相应的指令来改变屏幕亮度,比如`node index.js --set 50`将亮度设置为50%。为了提供更好的用户体验,命令行工具可能还会支持动态调整亮度,查询当前亮度,甚至设置亮度为...

    Brightness-effect_vb6effect_

    Dim brightness As Integer ' 亮度值 Dim bitmap As Bitmap Dim data As BitmapData Dim ptr As Long Dim stride As Long Dim x As Integer Dim y As Integer Dim r As Byte, g As Byte, b As Byte ' 加载...

    Brightness-master.zip

    《掌握屏幕亮度调整:Brightness-master.zip深度解析》 在当今数字化时代,无论是工作还是娱乐,我们与各种电子设备的交互日益频繁,其中屏幕亮度的调节是用户体验中的一个重要环节。"Brightness-master.zip" 文件...

    Brightness Guide v2.4.3.zip

    Brightness Guide是一款照片处理工具,可以将你曝光过度照片或是亮度太暗的照片处理成理想的状态,照片会自动识别添加的照片所需要执行的操作,虽然界面是英文界面但是开始会有段使用演示,使用很方便。 Brightness...

    HX8347-D_DS_T__preliminary_v01_080624_Foxlink.pdf

    - **Gamma Characteristic Correction Function**: Adjusts the brightness and contrast of the display to improve image quality. - **Tearing Effect Output Line**: A feature to minimize screen tearing when...

    KindleScripts:在 Kindle PW 上做事的脚本

    KindleScripts 这个 repo 包括一堆脚本,用于在 Kindle PW 上做各种事情 ..../set-brightness 254 # Set the brightness of the Kindle's frontlight to a value between 0 and 254 (inclusive) Debia

    笔记本屏幕亮度调节brightness controller v1.0.00

    笔记本屏幕亮度调节brightness controller v1.0.00

    XnView_v2.45yixueyingxiang

    - divisor = here you select the division ratio - which should equal to the sum of all weights in the matrix - if the effect is not to change the luminosity (brightness) of the pixel, - bias = this can...

    lpc900_pwm

    The general purpose timer T1 of the LPC932 is set up to PWM Mode 6. In this mode it becomes a 8 bit up-counter with a special 8 bit reload on overflow. The reload values are alternating and ...

    ImageMagick图片批量处理

    -alpha option activate, deactivate, reset, or set the alpha channel -antialias remove pixel-aliasing -authenticate password decipher image with this password -attenuate value lessen (or intensify...

    屏幕亮度

    屏幕亮度@capacitor-community/screen-brightness 电容器社区插件,用于控制iOS和...// Set the brightness:const halfBright = 0.5 ;await ScreenBrightness . setBrightness ( { halfBright } ) ;// Get the curre

    基于51单片机控制的点阵LED电子显示屏设计说明.doc

    It combines the efficiency and versatility of the microcontroller with the brightness and durability of LEDs to create a flexible display system suitable for various applications, from displaying ...

    TM1637四位数码管库arduino

    4. `set Brightness()`:设置数码管的亮度等级。 示例代码通常包含以下步骤: 1. 导入库:`#include <TM1637.h>` 2. 初始化:`TM1637 tm1637(DIO_PIN, CLK_PIN);` 3. 设置亮度:`tm1637.setBrightness(BRIGHTNESS_...

    DE2 web serve的源代码

    - The following i2c pins are used to configure the lcd panel for brightness and gamma curves * lcd_i2c_scl * lcd_i2c_en * lcd_i2c_sdat - The rest of the components that make up the video pipeline...

Global site tag (gtag.js) - Google Analytics