- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我的相机应用程序预览在低光下太暗。如果我打开我的谷歌相机,它会增加预览中的亮度,这样我们的脸就可以看到拍照了。但是我的预览是完全黑暗的。我已经处理了亮度和光传感器。我的光传感器在光线充足时工作。我需要使预览可见。让我有什么需要处理的?
public void initialBrightness() {
try {
brightnessMode = Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE);
} catch (Settings.SettingNotFoundException e) {
e.printStackTrace();
}
if (brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
brightnessModeAuto = true;
}
Settings.System.putInt(this.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 95);
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 100;
getWindow().setAttributes(lp);
}
我在调用相机预览类之前在 onCreate 方法中调用此方法。
最佳答案
要解决此问题,您必须解锁自动曝光补偿 并设置为最大值:
Camera.Parameters params = mCamera.getParameters();
params.setExposureCompensation(params.getMaxExposureCompensation());
if(params.isAutoExposureLockSupported()) {
params.setAutoExposureLock(false);
}
mCamera.setParameters(params);
根据 Android Develop > Reference > Camera.Parameters
Changing the white balance mode with setWhiteBalance(String) will release the auto-white balance lock if it is set.
Exposure compensation, AE lock, and AWB lock can be used to capture an exposure-bracketed burst of images, for example. Auto-white balance state, including the lock state, will not be maintained after camera release() is called.
Locking auto-white balance after open() but before the first call to startPreview() will not allow the auto-white balance routine to run at all, and may result in severely incorrect color in captured images.
所以要小心,在第一次调用 startPreview() 之后使用提到的代码
关于android - 相机预览在低光 android 中太暗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28429071/
我想要一个深色的 Activity 对话框主题,所以我定义如下: @color/colorPrimary @color/colorPrimaryDark @color/col
是否可以改变 UIVisualEffectView 的颜色超出标准的额外亮、亮和暗? 我需要实现明暗预设之间的阴影。 最佳答案 如果您想要类似于 UIVisualEffectView 但控制更多的东西
在这个 fiddle 上,函数完美地完成了工作,但我需要稍微调整连接。 该点击甚至需要是父 div 的 addClass(深色/浅色)(true 或 false)。 如果是深色,则添加 Bright
以前拖动到 Xcode Assets 目录中的图像可以命名如下 ... Rabbit@2x.png Rabbit@3x.png 释放拖动后,这些图像会自动分配到目录中正确的 2x 和 3x 位置。 现
如何获得 Emacs 的背景类型?例如'light或 'dark 你可以像这样定义一张脸: (defface moedict-type '((((class color) (background
我们有几个使用 mongoose 的 nodejs 守护进程,同时共享相同的持久层(包含查询的共享模块)。 在其中一个守护进程(总是同一个)中,我们随机(每周几次)从 mongoose 得到以下错误:
我是一名优秀的程序员,十分优秀!