【发布时间】:2011-06-11 00:48:31
【问题描述】:
我提出了 AVFoundation 和 ImageIO 的实现来处理我的应用程序中的照片拍摄。但是,我有一个问题。即使闪光灯熄灭,我拍摄的图像也总是很暗。这是我使用的代码:
[[self currentCaptureOutput] captureStillImageAsynchronouslyFromConnection:[[self currentCaptureOutput].connections lastObject]
completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) {
[[[blockSelf currentPreviewLayer] session] stopRunning];
if (!error) {
NSData *data = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];
CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef) data, NULL);
if (source) {
UIImage *image = [blockSelf imageWithSource:source];
[blockSelf updateWithCapturedImage:image];
CFRelease(source);
}
}
}];
有什么东西会导致拍摄的图像不包括闪光灯吗?
【问题讨论】:
标签: ios ios4 avfoundation