How to convert UIView as UIImage?
问题 I am taking screenshot image from currentview.but i want to set frame….don't want to convert fullview as image.I gave frame size..but it takes always Image as fullview..any help please? CGRect rectt = CGRectMake(100, 150,150,200); UIGraphicsBeginImageContext(rectt.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageView *imgView = [[UIImageView alloc] initWithFrame:rectt]; 回答1: