0

我通过使用构建应用程序打开相机,UIImagePickerController但我想在拍照之前,我可以调整 LED 的强度。我认为如果可以在拍照前添加 UISlider 来UIImagePickerController调整亮度 LED 很好,但我不知道如何添加UISliderUIImagePickerController.

你有想法吗?

4

1 回答 1

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.`
于 2013-06-19T06:36:17.493 回答