支持iOS 6.0 and later
    CIContext *context = [CIContext contextWithOptions:nil];   
    CIImage *inputImage = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"1.png"]];   
    // create gaussian blur filter   
    CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];   
    [filter setValue:inputImage forKey:kCIInputImageKey];   
    [filter setValue:[NSNumber numberWithFloat:10.0] forKey:@"inputRadius"];   
    // blur image   
    CIImage *result = [filter valueForKey:kCIOutputImageKey];   
    CGImageRef cgImage = [context createCGImage:result fromRect:[result extent]];   
    UIImage *image = [UIImage imageWithCGImage:cgImage];   
    CGImageRelease(cgImage);   
    self.mainImageView.image = image;  

发布评论

分享到:

IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!

iOS实现爆炸的效果详解
你是第一个吃螃蟹的人
发表评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。