我有一个照片应用程序,您可以在一个部分添加贴纸.当你完成后我想保存图像.这是我必须做的代码.
if(UIGraphicsBeginImageContextWithOptions != NULL)
{
UIGraphicsBeginImageContextWithOptions(self.view.frame.size, YES, 2.5);
} else {
UIGraphicsBeginImageContext(self.view.frame.size);
}
CGContextRef contextNew=UIGraphicsGetCurrentContext();
[self.view.layer renderInContext:contextNew];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Run Code Online (Sandbox Code Playgroud)
现在保存的图像是图像的全屏,这很好,但现在我需要裁剪图像,我不知道如何.您可以在以下链接中看到图像:http: //dl.dropbox.com/u/19130454/Photo%202012-04-09%201%2036%2018%20PM.png
我需要裁剪:从左侧91px和从底部220px右侧裁剪
任何帮助将不胜感激.如果我没有清楚地解释清楚,请告诉我,我会尽力重新解释.