我通过使用构建应用程序打开相机,UIImagePickerController
但我想在拍照之前,我可以调整 LED 的强度。我认为如果可以在拍照前添加 UISlider 来UIImagePickerController
调整亮度 LED 很好,但我不知道如何添加UISlider
到UIImagePickerController
.
你有想法吗?
我通过使用构建应用程序打开相机,UIImagePickerController
但我想在拍照之前,我可以调整 LED 的强度。我认为如果可以在拍照前添加 UISlider 来UIImagePickerController
调整亮度 LED 很好,但我不知道如何添加UISlider
到UIImagePickerController
.
你有想法吗?
CGFloat 亮度 = 0.5;
UIGraphicsBeginImageContext(image.size);
CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height);
CGContextRef context = UIGraphicsGetCurrentContext();
// Original image
[image drawInRect:imageRect];
// Brightness overlay
CGContextSetFillColorWithColor(context, [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:brightness].CGColor);
CGContextAddRect(context, imageRect);
CGContextFillPath(context);
UIImage* resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
`You can change brightness overlay color to get proper results.`