【发布时间】:2015-10-28 02:25:21
【问题描述】:
我有一些代码,我在其中抓取屏幕图像,然后根据一些边界值对其进行裁剪:
UIGraphicsBeginImageContextWithOptions(self.mainView.bounds.size, NO, 0.0);
[self.mainView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *comicImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIGraphicsBeginImageContextWithOptions(CGSizeMake(boundary.width, boundary.height), NO, 0.0);
[comicImage drawAtPoint:CGPointMake(-boundary.xMin, -boundary.yMin)];
comicImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
我想知道的是,我是否使用上述方法生成了低分辨率的低质量图像?有没有更好的方法来做到这一点?
【问题讨论】:
-
我遇到了同样的问题。截屏并裁剪它总是使它质量很差。找不到其他选项。
标签: ios cocoa-touch uiimage