I have imageView
with Aspect fit mode. I have added the another view on the imageView
.
I want to take a screenshot of the imageView
without compressing (as same resolution as before).
I have tried the following code
UIGraphicsBeginImageContextWithOptions(CGSizeMake(imgView.image.size.width, imgView.image.size.height), NO, 1.0);
[imgView drawViewHierarchyInRect:CGRectMake(0, 0, imgView.image.size.width, imgView.image.size.height) afterScreenUpdates:YES];
UIImage * Image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
But the end image is streach. What should I do?
I think it includes the transparent portion here. is there any way to not to include in that