我正在寫一個iPhone應用程序,使用AVFoundation的相機的東西,我試圖將UIImage從相機保存到相機膠捲。讓UIImage走出捕捉殭屍圖像AsynchronouslyFromConnection
目前,它確實是這樣......
[imageCaptureOutput captureStillImageAsynchronouslyFromConnection:[imageCaptureOutput.connections objectAtIndex:0]
completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error)
{
if (imageDataSampleBuffer != NULL)
{
NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];
UIImage *image = [[UIImage alloc] initWithData:imageData];
MyCameraAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate processImage:image];
}
}];
我一直在看WWDC的視頻教程,和我認爲2號線(NSData的...和...的UIImage)是一個很長的路要走從imageDataSampleBuffer獲取一個UIImage。
將圖像保存到圖庫似乎需要很長的時間。
有誰知道是否有一個單一的行轉換從這個UIImage?
感謝您的幫助!
奧利弗
啊,我仔細看了一下發生了什麼事情,這不是花費很長時間的轉換,而是將它保存到Photo庫中。 – Fogmeister 2010-09-06 12:48:39