【发布时间】:2015-07-30 15:08:06
【问题描述】:
我正在开发一个应用程序,允许用户在他们的照片上添加蒙版,该应用程序运行良好,但我注意到一个问题,我不知道为什么,但图像质量下降。 我正在使用这种方法将图像传递给视图控制器:
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
//SETTO STICKERS
UIGraphicsBeginImageContext(CGSizeMake(_Image.frame.size.width, _Image.frame.size.height));
CGContextRef context = UIGraphicsGetCurrentContext();
[_Image.layer renderInContext:context];
UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
appDelegate.ImageEnded = screenShot;
//Instanzio il viewController della main
LastViewController *VC = [self.storyboard instantiateViewControllerWithIdentifier:@"LastVC"];
//Vado alla main
[self presentModalViewController:VC animated:YES];
并通过使用 appdelegate 从另一个 ViewController 获取图像,这是我的完整应用程序流程:
FirstScreen(ViewController) -> 拍照或从图库中选择 ->
AddMask(ViewController) -> AddStickers(ViewController) -> 最后一个视图控制器(视图控制器)。
【问题讨论】:
标签: ios objective-c iphone uiviewcontroller photo-gallery