I am taking a snapshot of an area of my view and setting it to a new UIView.
UIView *currView = [self.view resizableSnapshotViewFromRect:mp.moviePlayer.view.frame afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero];
[currView setFrame:CGRectMake(0, 0, 204, 128)];
Then I am trying to set a UIIamgeView image using this:
[image2 setImage:[self getUIImageFromThisUIView:currView]];
-(UIImage*)getUIImageFromThisUIView:(UIView*)aUIView
{
UIGraphicsBeginImageContext(aUIView.bounds.size);
[aUIView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return viewImage;
}
But it does not set the UIImageView's image to anything? Thanks in advance