brightness

iPhone brightness private API not working properly

╄→гoц情女王★ 提交于 2019-12-31 01:53:08
问题 I am trying to set the brightness of the backlight, but it's acting very strangely. I am using the private API: [(id)[UIApplication sharedApplication] setBacklightLevel:1.0f]; However, when I call this, the screen dims, not becoming 100% bright like I thought it would. I have tested this with a variety of numbers, and here is what I got: 0.2: dark 0.3: light 0.4: dark 0.5: dark 0.6: light 0.7: dark 0.8: dark 0.9: dark 1.0: dark 1.1: dark 1.2: light 1.3: dark 1.4: dark 1.5: light Some of the

Turn off/on android screen

*爱你&永不变心* 提交于 2019-12-25 17:35:17
问题 I am trying to turn the android screen off and then on again, after a few seconds. The "turn off" part works, with this code: WindowManager.LayoutParams layoutParam = getWindow().getAttributes(); oldBrightness = android.provider.Settings.System.getInt(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS)/255f; layoutParam.screenBrightness = 0; layoutParam.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; getWindow().setAttributes(layoutParam); But then, when I try

Not able to get rid of NullPointerException when changing brightness of an image and passing the brightness value to another intent

穿精又带淫゛_ 提交于 2019-12-25 10:21:49
问题 In my app, I am changing the brightness of an image within an ImageView in Activity B and I'm passing the image as well as the brightness changed to Activity A. But when recieving the result in Activity A, I get a NullPointerException. Here is part of code in Activity A: On a button click: btn_Edit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent editIntent = new Intent(HowItWorksActivity.this, EditPhotoActivity.class); if (current_working_image

Not able to get rid of NullPointerException when changing brightness of an image and passing the brightness value to another intent

左心房为你撑大大i 提交于 2019-12-25 10:21:13
问题 In my app, I am changing the brightness of an image within an ImageView in Activity B and I'm passing the image as well as the brightness changed to Activity A. But when recieving the result in Activity A, I get a NullPointerException. Here is part of code in Activity A: On a button click: btn_Edit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent editIntent = new Intent(HowItWorksActivity.this, EditPhotoActivity.class); if (current_working_image

Screen brightness in J2ME

风格不统一 提交于 2019-12-24 16:28:30
问题 Do you know of any means for changing the screen brightness in J2ME. That is using a vendor-specific API, like Samsung's, etc. Thanks! 回答1: I think the closest is Display.flashBacklight(int duration) http://www.microemu.org/microemu-midp/apidocs/javax/microedition/lcdui/Display.html#flashBacklight%28int%29 Also see http://support.developer.motorola.com/cgi-bin/motodev.cfg/php/enduser/std_adp.php?p_faqid=592&p_created=1170311265&p_topview=1 回答2: There is away to do it with the Nokia-specific

How to enable/disable auto brightness mode from API

我怕爱的太早我们不能终老 提交于 2019-12-24 10:38:44
问题 I want to control the system settings "auto brightness", setting it ON or OFF. I'm able to control the brightness level but only if AUTO is OFF. From what I read until now there is a SCREEN_BRIGHTNESS_MODE in Settings.System but only for API level 8 or higher and also not recommended to mess wit it. But currently my phone has Android 2.1 (API 7) and there are widgets that can control this setting (enable/disable auto brightness and set the level). How is this done? 回答1: I solved my problem

Android screen brightness that doesn't crash

六月ゝ 毕业季﹏ 提交于 2019-12-24 09:49:21
问题 I have an activity that boosts screen brightness /* turn screen brightness up */ this.getWindow().getAttributes().screenBrightness = 1; I found out this built in android function crashes some phones. Is there a more universal way to boost screen brightness? 回答1: The correct way to set attributes is with setAttributes() : WindowManager.LayoutParams lp = this.getWindow().getAttributes(); lp.screenBrightness = 1; this.getWindow().setAttributes(lp); 回答2: You can try the value that is almost 1 .

Increasing screen brightness for activity

依然范特西╮ 提交于 2019-12-24 09:41:47
问题 There are apparently at least three different techniques for changing screen brightness in the Android OS. Two of them no longer work post-cupcake and the third accepted technique evidently has a bug. I would like to increase screen brightness at the start of a one-view activity then turn the brightness back to the user setting at the end of the activity. No buttons, no second view or second activity. Just a maxed brightness at start and a return to original brightness setting at the end of

Luminance Matching Two Colors

狂风中的少年 提交于 2019-12-21 20:52:57
问题 This will likely seem like a very easy thing I'm trying to do but Google search has not turned up exactly what I'm looking for and I'd like to do this correctly. Essentially I need to luminance match two bmps. They are simple circles (125x125 pixels) and their original color is only know to me by their (0-255 ranged) RGB value of 255,0,0. I need to find an RGB value of gray that is the same luminance of these circles. All other luminance/brightness matching tutorials I have seen have been for

winapi change brightness

若如初见. 提交于 2019-12-21 20:23:34
问题 What winapi's are there to change the screen's brightness? I've been attempting to look for an example or API I can use for Delphi but have not found anything. 回答1: Starting with Windows Vista you can use the GetMonitorBrightness and SetMonitorBrightness functions. function GetMonitorBrightness( hMonitor : THandle; var pdwMinimumBrightness : DWORD; var pdwCurrentBrightness : DWORD; var pdwMaximumBrightness : DWORD ) : BOOL; stdcall ; external 'Dxva2.dll' name 'GetMonitorBrightness'; function