我使用UIImagePickerController
构建应用程序打开相机,但我想在拍照之前,我可以调整LED的强度。我想如果可以在UIImagePickerController
之前添加UISlider以调整亮度LED,然后拍照就好了,但我不知道如何将UISlider
添加到UIImagePickerController
。
你有想法吗?
答案 0 :(得分:0)
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.`