priore

Capture blurred UIView

Apr 23rd, 2014
651
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×