SHARE
TWEET

Capture blurred UIView

priore Apr 23rd, 2014 474 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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top