iOS 模糊效果的实现
来源:互联网 发布:pdf文件分割软件 编辑:程序博客网 时间:2024/05/20 02:26
有些时候,我们需要一些特殊的视觉效果,实现图片的模糊展示,实现代码如下:
- (void)viewDidLoad { [super viewDidLoad]; UIImage * image = [UIImage imageNamed:@"leftbackiamge"]; CIImage * ciImage = [[CIImage alloc]initWithImage:image]; CIFilter * blurFilter = [CIFilter filterWithName:@"CIGaussianBlur"]; [blurFilter setValue:ciImage forKey:kCIInputImageKey]; CIImage * outImage = [blurFilter valueForKey:kCIOutputImageKey]; CIContext * context = [CIContext contextWithOptions:nil]; CGImageRef outCGImage = [context createCGImage:outImage fromRect:[outImage extent]]; UIImage * blurImage = [UIImage imageWithCGImage:outCGImage]; CGImageRelease(outCGImage); UIImageView * imageView = [[UIImageView alloc]initWithFrame:self.view.bounds]; imageView.image = blurImage; [self.view addSubview:imageView];}
效果图如下:
1 0
- iOS 模糊效果的实现
- iOS模糊效果的实现
- 【iOS】iOS下高斯模糊效果的实现
- iOS实现模糊效果
- iOS 模糊效果实现
- iOS 实现模糊效果
- iOS模糊效果实现
- iOS 模糊效果实现
- 【转】ios 半透明模糊效果的实现
- IOS实现图片的模糊效果
- iOS 如何实现模糊效果
- iOS 如何实现模糊效果
- iOS中实现模糊效果
- 使用GPUImage实现iOS 7的模糊效果
- iOS 8 模糊视图(毛玻璃效果)的简单实现UIVisualEffectView
- 使用GPUImage实现iOS 7的模糊效果
- iOS开发中模糊效果的实现方案
- iOS 模糊效果的几种实现方法
- 关于窗口创建的那些事 之 内核剖析 读笔
- 网卡MAC地址查询厂商
- Service启动模式
- linux下的定时任务cron
- opencv 内存中读取一段jpg 图片
- iOS 模糊效果的实现
- FFPlay视频播放流程
- swift Dictionary操作
- 今天做错的笔试题:StringBuffer引用传参
- Linux套接字通信常用函数-accept
- android安全
- CoreGraphics框架中的CGAffineTransform
- ScrollView和ListView嵌套发生错误的问题
- 排序