Objective-C Tips & Trick - Prioregroup.com
[Objective-C] Capture blurred UIView
       
back

#import "UIImage+DSP.h" // https://github.com/gdawg/uiimage-dsp

- (UIImage*)captureView
{
    // cattura la screen attuale
    UIGraphicsBeginImageContextWithOptions(self.bounds.size, YES, 0.0f);
    CGContextRef context = UIGraphicsGetCurrentContext();
    [self.layer renderInContext:context];
    UIImage *capturedScreen = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return capturedScreen;
}

- (UIImage*)captureBlurredView
{
    return [[self captureView] imageByApplyingGaussianBlurOfSize:11 withSigmaSquared:90.0];
}






Copyright © 1996-2018 Centro Studi Informatica di Danilo Priore. All rights reserved. P.I.10149810581.
prioregroup.com