
captureStillImageAsynchronouslyFromConnection:completionHandler:
for AVCaptureStillimageOutput?
>(voID)captureDelegate:(CMSampleBufferRef)缓冲区错误:(NSError *)错误;
?
解决方法 使用块.像这样的东西:
[[self stillimageOutput] captureStillimageAsynchronouslyFromConnection:vIDeoConnection completionHandler:^(CMSampleBufferRef imageDataSampleBuffer,NSError *error) { if (imageDataSampleBuffer != NulL) { NSData *imageData = [AVCaptureStillimageOutput jpegStillimageNSDataRepresentation:imageDataSampleBuffer]; UIImage *image = [[UIImage alloc] initWithData:imageData]; ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library writeImagetoSavedPhotosAlbum:[image CGImage] orIEntation:(ALAssetorIEntation)[image imageOrIEntation] completionBlock:^(NSURL *assetURL,NSError *error){ if (error) { ID delegate = [self delegate]; if ([delegate respondsToSelector:@selector(captureStillimageFailedWithError:)]) { [delegate captureStillimageFailedWithError:error]; } } }]; [library release]; [image release]; } else if (error) { ID delegate = [self delegate]; if ([delegate respondsToSelector:@selector(captureStillimageFailedWithError:)]) { [delegate captureStillimageFailedWithError:error]; } } }]; 总结 以上是内存溢出为你收集整理的iphone – 你如何使用AVCaptureStillImageOutput,captureStillImageAsynchronouslyFromConnection?全部内容,希望文章能够帮你解决iphone – 你如何使用AVCaptureStillImageOutput,captureStillImageAsynchronouslyFromConnection?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)