Created
December 1, 2016 17:49
-
-
Save akio46/bee3fb6bc2141d8695a1a343a54d0051 to your computer and use it in GitHub Desktop.
get screenshot image of specific view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIImage *)getSnapshotFromView:(UIView *)v { | |
UIGraphicsBeginImageContextWithOptions(v.bounds.size, NO, 0.0f); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
[v.layer renderInContext:context]; | |
UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return snapshotImage; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment