Advertisement
priore

Capture blurred UIView

Apr 23rd, 2014
1,018
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import "UIImage+DSP.h" // https://github.com/gdawg/uiimage-dsp
  2.  
  3. - (UIImage*)captureView
  4. {
  5.     // cattura la screen attuale
  6.     UIGraphicsBeginImageContextWithOptions(self.bounds.size, YES, 0.0f);
  7.     CGContextRef context = UIGraphicsGetCurrentContext();
  8.     [self.layer renderInContext:context];
  9.     UIImage *capturedScreen = UIGraphicsGetImageFromCurrentImageContext();
  10.     UIGraphicsEndImageContext();
  11.     return capturedScreen;
  12. }
  13.  
  14. - (UIImage*)captureBlurredView
  15. {
  16.     return [[self captureView] imageByApplyingGaussianBlurOfSize:11 withSigmaSquared:90.0];
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement