Utilisation suivant code et Importer <QuartzCore/QuartzCore.h>
. Vous pouvez également utiliser ce code après la capture de l'image. Donc, vous pouvez supprimer une partie inutile de cela.
UIGraphicsBeginImageContext(self.view.frame.size);
//or
UIGraphicsBeginImageContextWithOptions(self.view.frame.size, NO, 0.0);//this will also give you scaling option and more better for resolution.
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
CGImageRef ref = viewImage.CGImage;
CGRect myImageArea = CGRectMake (20, 20,
300, 100);// you define coordinates according your requirements.
CGImageRef mySubimage = CGImageCreateWithImageInRect (ref, myImageArea);
UIImage *yourfinalcapturedimage = [UIImage imageWithCGImage:mySubimage];// this will give you your required image.
Hope, cela vous aidera ..