Created
March 13, 2014 22:42
-
-
Save phatduckk/9538695 to your computer and use it in GitHub Desktop.
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 *)screenshotBlurred { | |
UIImage *blurItemImage = [self.screenshot stackBlur:25]; | |
return blurItemImage; | |
} | |
- (UIImage *)screenshot { | |
CGRect rect = [self bounds]; | |
UIGraphicsBeginImageContext(rect.size); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
[self.layer renderInContext:context]; | |
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
UIImage *uiImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:1.0 orientation:UIImageOrientationUp]; | |
return [uiImage normalize]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment