У меня есть приложение для фото, в которое вы можете добавить наклейки в один раздел. Когда вы закончите, я хочу сохранить изображение. Вот код, который я должен сделать.
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();
Теперь изображение, которое будет сохранено, - это полный экран изображения, что хорошо, но теперь мне нужно обрезать изображение, и я не знаю, как это сделать. Вы можете увидеть изображение по ссылке ниже: http://dl.dropbox.com/u/19130454/Photo%202012-04-09%201%2036%2018%20PM.png
Мне нужно обрезать: 91px слева и справа 220px снизу
Любая помощь будет принята с благодарностью. Если я не объясню вещи четко, пожалуйста, дайте мне знать, и я сделаю все возможное, чтобы объяснить.