我想拍攝AVCaptureSession for iOS的照片,我可以拍照,但需要打印屏幕並將其保存在PhotoLibrary上,如何獲得真實照片而不是打印屏幕並保存查看不在圖書館,請你幫我在這個實施中,iOS - 使用AVCaptureSession拍攝圖像
在此先感謝!
這裏是我的代碼:
CGImageRef UIGetScreenImage(void);
- (void) scanButtonPressed {
CGImageRef screen = UIGetScreenImage();(what should I use here instead of
UIGetScreenImage)
UIImage* image = [UIImage imageWithCGImage:screen];
CGImageRelease(screen);
// Save the captured image to photo album
UIImageWriteToSavedPhotosAlbum(image, self,
@selector(image:didFinishSavingWithError:contextInfo:), nil);
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void
*)contextInfo
{
UIAlertView *alert;
if (error)
alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Unable to save image to Photo Album."
delegate:self cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
else {
CoverCapturePhoto *c = [[CoverCapturePhoto alloc] init];
[self.navigationController pushViewController:c animated:YES];
[c.captureImage setImage:image];
}
[alert show];
}
你確實是指使用相機,或採取屏幕抓取,但不使用私人API? – Wain
@是否使用相機並拍攝照片並將其顯示到其他屏幕 –