screen-brightness

How to dim a screen on click of a button in android?

拜拜、爱过 提交于 2019-12-12 10:16:03
问题 How do i darken/dim the current screen on click of a button. PLease help me. 回答1: Here's one solution, though it may not be the best: create styles.xml under res/values. Add the following code: <style name="Theme.Translucent" parent="android:Theme"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@color/cache_color</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowNoTitle">true</item> <item name="android

Change brightness of jframe

耗尽温柔 提交于 2019-12-11 04:49:33
问题 I have a program, and it runs in a jframe in full screen exclusive mode. I am trying to change the brightness of the jframe. I was wondering how i would implement this. I thought it might be possible to change all the colors of the images getting drawn to the jframe and make them brighter, but it still does not change how bright the screen actually is. How do programs normally implement something like this. 回答1: At the end of your draw loop: g.setColor(new Color(0, 0, 0, 0.5f)); // 50% darker

How do I determine the direction (up or down) of a UIPanGesture?

☆樱花仙子☆ 提交于 2019-12-11 02:12:40
问题 My goal is to set the iPhone's brightness with up or down pan gestures. If there is a simple way to determine the pan's direction, I can't figure it out. I added a swipe gesture recognizer, then the following code: - (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; } but my pan: method never seems to be able to determine the direction of the pan. I've set "self" as

how change screen led like Cyanogenmod widgetrenderFx night mod

泄露秘密 提交于 2019-12-11 01:32:29
问题 i work about application how can change android screen brightness, can somme help me by giving some examples of how to doing this. Thanks :-) 回答1: This peice of code will set the brightness: private void setBrightness(int brightness) { try { IHardwareService hardware = IHardwareService.Stub.asInterface( ServiceManager.getService("hardware")); if (hardware != null) hardware.setScreenBacklight(brightness); } catch (RemoteException doe) { } } Do not forget to add to your manifest <uses

SCREEN_BRIGHTNESS_MODE does not work with permission

情到浓时终转凉″ 提交于 2019-12-10 22:19:56
问题 In my app I want to change the SCREEN_BRIGHTNESS_MODE (and set another value). I added the permission in the AndroidManifest.xml (double checked with other parameters in the file). The value of the mode should be changed, when a button was pressed. @Override public void onClick(View v) { if(on) { ContentResolver cResolver = getContentResolver(); Settings.System.putInt(cResolver, Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL); Settings.System.putInt

Is iphone simulator's brightness adjustable?

≯℡__Kan透↙ 提交于 2019-12-10 12:46:07
问题 i tried to use the most of the correct answers suggested by the users to adjust the brightness of the iphone (ie [[UIScreen mainScreen]setBrightness:0.0]; ) but the simulator didn't change its brightness. Is iphone simulator's brightness adjustable? 回答1: The iPhone simulator brightness is not adjustable, you have to try in a real device! 回答2: The iPhone simulator is not a hardware simulator. It simulates some of the hardware functions but mostly it is a simulator for iOS. You will need to

Setting color brightness on Linux/Xorg

我怕爱的太早我们不能终老 提交于 2019-12-10 05:16:56
问题 Is there any command (or API) to set X.Org/Linux color brightness? In other words, I need something as handy as the xgamma command but for changing RGB brightness real-time . Is this possibile? 回答1: Use the XF86VidMode* family of functions. #include <X11/Xlib.h> #include <X11/extensions/xf86vmode.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main() { Display *display; int screen; int major, minor; int i; XF86VidModeGamma orig; display = XOpenDisplay(NULL)

Change adaptive brightness level programmatically

 ̄綄美尐妖づ 提交于 2019-12-08 06:01:05
问题 How can I change the adaptive brightness level programmatically, on Android Lollipop? I know how to change the manual brightness level , and to toggle on or off the adaptive brightness . It is done like that: Settings.System.putInt(cr, Settings.System.SCREEN_BRIGHTNESS, newLevel); However, with adaptive brightness is enabled, the OS combines it with another brightness level which is different than the manual one. Is there a way to do this? Target/min/max SDK is 21. 回答1: Don't know why but

Change adaptive brightness level programmatically

允我心安 提交于 2019-12-07 16:22:24
How can I change the adaptive brightness level programmatically, on Android Lollipop? I know how to change the manual brightness level , and to toggle on or off the adaptive brightness . It is done like that: Settings.System.putInt(cr, Settings.System.SCREEN_BRIGHTNESS, newLevel); However, with adaptive brightness is enabled, the OS combines it with another brightness level which is different than the manual one. Is there a way to do this? Target/min/max SDK is 21. Don't know why but there is a hidden constant SCREEN_AUTO_BRIGHTNESS_ADJ in Android API to adjust adaptive brightness. But you can

Adjust Mac display brightness Objective-C?

ⅰ亾dé卋堺 提交于 2019-12-06 10:11:34
问题 Is there a way to adjust the Mac's display brightness in Objective-C? I have sensitive eyes, and sometimes the display seems like it could be darker. Combine that with Jeff's blog post about geeks and darkness, and it can get pretty annoying. I think it would stand to reason that if the display could be set as a number value, it could get set lower than the regular screen brightness. I have Googled all over, but all of the things that came up were about the iPhone. Is there a way to do it for