iOS 8 Camara可以在点击camara时调整亮度。
我也试过这段代码但没有用。
AVCaptureDevice *device =[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
AVCaptureWhiteBalanceGains deviceWhiteBalance;// = [device deviceWhiteBalanceGains];
AVCaptureWhiteBalanceTemperatureAndTintValues tempAndTint = [device temperatureAndTintValuesForDeviceWhiteBalanceGains:[device deviceWhiteBalanceGains]];
tempAndTint.temperature = (slider.value*100)*10000/100;
if (slider.value < 0.50) {
tempAndTint.tint = -(slider.value*100)*150/100;
}
else{
tempAndTint.tint = (slider.value*100)*150/100;
}
deviceWhiteBalance = [device deviceWhiteBalanceGainsForTemperatureAndTintValues:tempAndTint];
[device chromaticityValuesForDeviceWhiteBalanceGains:deviceWhiteBalance];
dispatch_async(dispatch_get_main_queue(), ^{
AVCaptureDevice *device =[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if (device) {
[device setWhiteBalanceModeLockedWithDeviceWhiteBalanceGains:deviceWhiteBalance completionHandler:^(CMTime syncTime) {
}];
}
});