大佬教程收集整理的这篇文章主要介绍了高斯模糊滤镜逆转:iOS,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
//Get a UIImage from the UIView UIGraphicsBeginImageContext(self.view.bounds.sizE); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); //Blur the UIImage CIImage *imageToBlur = [CIImage imageWithCGImage:viewImage.CGImage]; CIFilter *gaussianBlurFilter = [CIFilter filterWithName:@"CIGaussianBlur"]; [gaussianBlurFilter SETVALue:imageToBlur forKey:@"inputImage"]; [gaussianBlurFilter SETVALue:[NSnumber numberWithFloat:2] forKey:@"inpuTradius"]; CIImage *resultImage = [gaussianBlurFilter valueForKey:@"outputImage"]; UIImage *endImage = [[UIImage alloc] initWithCIImage:resultImage]; //Place the UIImage in a UIImageView newView = [[UIImageView alloc] initWithFrame:self.view.bounds]; newView.image = endImage; [self.view addSubview:newView];
它工作得很好,但我希望能够将其反转并使视图恢复正常.
我怎么能这样做,因为试图简单地从它的超视图中移除模糊的视图不起作用.我也尝试过将各种属性设置为零而没有运气.
以上是大佬教程为你收集整理的高斯模糊滤镜逆转:iOS全部内容,希望文章能够帮你解决高斯模糊滤镜逆转:iOS所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。