首先得截取主示图像
UIGraphicsBeginImageContext(self.view.frame.size); //currentView 当前的view
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
然后从而主示图像,截取所需要的部分.
UIImage *firstImage = [UIImage imageWithCGImage:CGImageCreateWithImageInRect(viewImage .CGImage, CGRectMake(0,0,50,50))];