[翻译] CRPixellatedView-用CIPixellate滤镜动态渲染UIView
CRPixellatedView-用CIPixellate滤镜动态渲染UIView

https://github.com/chroman/CRPixellatedView
本人测试的效果:

Usage
To use CRPixellatedView, create a CRPixellatedView, configure and animate!
要使用CRPixellatedView的话,创建一个CRPixellatedView,配置以及做动画!
An example of making a CRPixellatedView:
以下是一个使用CRPixellatedView的例子:
CRPixellatedView *pixellatedView = [[CRPixellatedView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
pixellatedView.image = [UIImage imageNamed:@"Image"];
[self.view addSubview:pixellatedView]; // Add to your view
[pixellatedView animate];
You can configure this settings, customizable example:
以下是配置设置,自定义的例子:
CRPixellatedView *pixellatedView = [[CRPixellatedView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
pixellatedView.image = [UIImage imageNamed:@"Image"];
pixellatedView.pixelScale = 20.0f;
pixellatedView.animationDuration = 0.8f;
[self.view addSubview:pixellatedView]; // Add to your view
[pixellatedView animateWithCompletion:^(BOOL finished) {
NSLog(@"completed");
}];
Also, you can customize the animation effect using the reverse property:
以下是你使用反转效果的例子:
CRPixellatedView *pixellatedView = [[CRPixellatedView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
pixellatedView.image = [UIImage imageNamed:@"Image"];
pixellatedView.pixelScale = 20.0f;
pixellatedView.animationDuration = 0.8f;
pixellatedView.reverse = YES; // Reverse effect
[self.view addSubview:pixellatedView]; // Add to your view
[pixellatedView animateWithCompletion:^(BOOL finished) {
NSLog(@"completed");
}];
Examples
pixellatedView.reverse = YES; // Reverse effect


pixellatedView.reverse = NO; // (default)
pixellatedView.pixelScale = 30.0f;

核心的地方:
使用了3个CoreImage的滤镜用来重绘View:)

[翻译] CRPixellatedView-用CIPixellate滤镜动态渲染UIView的更多相关文章
- iOS给图片添加滤镜&使用openGLES动态渲染图片
给图片增加滤镜有这两种方式: CoreImage / openGLES 下面先说明如何使用CoreImage给图片添加滤镜, 主要为以下步骤: #1.导入CIImage格式的原始图片 #2.创建CIF ...
- iOS CoreImage图片处理动态渲染(滤镜)
// // ViewController.m // CoreImageOfDong // // Created by Dong on 15/6/30. // Copyright (c) 201 ...
- Django动态渲染多层菜单
为后续给菜单设置权限管理方便,通过给页面模版菜单动态渲染,通过数据菜单表进行匹配需要渲染的菜单 #Django表结构 class Menus(models.Model): name = models. ...
- 使用MVVM框架时,如何处理在页面动态渲染完之后需要发生的事件呢?
在项目实践过程中,当我们使用如avalon这样的MVVM框架时,通常会发现一直会有个问题. 过往的经验告诉我们,想在页面加载完之后处理些事件我们可以绑定document的ready方法或者使用jque ...
- JS动态修改页面EasyUI datebox不生效、EasyUI动态添加Class、EasyUI动态渲染解析解决方案
这是个小菜在实际工作中遇到的问题,相信很多EasyUI新手很可能也遇到这样的问题,因此小菜觉得有必要拿出来分享一下. 这个问题要从EasyUI的datebox组件说起,小菜用这个组件的时候,发现用$( ...
- vue + element 动态渲染、移除表单并添加验证
博客地址:https://ainyi.com/66 又接到新需求了吧~~ 背景 在一个大表单里,有可能会出现这种需求,用户可以自己操作动态添加.移除表单,更加个性化的效果. 常见于填写个人信息.附加内 ...
- 动态渲染页面爬取-Selenium & Splash
模拟浏览器的动机 JS动态渲染的页面不止Ajax一种 很多网页的Ajax接口含有加密参数,分析其规律的成本过高 通过对浏览器运行方式的模拟,我们将做到:可见即可爬 Python中常用的模拟浏览器运行的 ...
- iview 动态渲染menu时active-name无效的问题
动态渲染menu时,如果需要active-name,那么name只能绑定index,动态渲染的数组初始必须有一个空对象.否则无法使用active-name属性.注:仅限3.0版本,不排除新版本修复的可 ...
- vue使用动态渲染v-model输入框无法输入内容
最近使用ElementUI框架,在动态渲染表单的时候,表单框无法输入内容,但是绑定model的数据是会发生变化 解决方法: 将动态生成的表单对象,深拷贝到 data 对象中 <el-date-p ...
随机推荐
- mongodb-导出数据到csv文件或json文件
在mongodb的bin目录下, 有一个mongoexport, 可用于数据的导出 [wenbronk@localhost bin]$ ./mongoexport --help Usage: mong ...
- InnoSetup打包时出现Interal error: CallSpawnServer: Unexpected response: $0.错误的解决办法
如果在使用Innosetup打包软件时,如果出现Interal error: CallSpawnServer: Unexpected response: $0.错误, 如下图: 可以查看 Innose ...
- spring cloud连载第三篇之Spring Cloud Netflix
1. Service Discovery: Eureka Server(服务发现:eureka服务器) 1.1 依赖 <dependency> <groupId>org.spr ...
- 自动化部署MySQL 5.6 步骤 制作到ftp共享,永远使用
首先需要搭建ftpserver yum install vsftpd service vsftpd start 这样ftp服务就起来了,这里只是简单的使用,所以没有使用配置文件.这样我们只要将需要的文 ...
- .net mvc Razor 三元运算判断赋值 ?:
预期效果: 当Model中的Age数字列值为0时,不显示该值. <input type="text" class="form-control onlyPositiv ...
- [转]微信小程序之购物数量加减 —— 微信小程序实战商城系列(3)
本文转自:http://blog.csdn.net/michael_ouyang/article/details/70194144 我们在购买宝贝的时候,购物的数量,经常是我们需要使用的,如下所示: ...
- mongodb自学
http://www.runoob.com/mongodb/mongodb-databases-documents-collections.html
- 规范大于编码-我的javaWeb开发规范
1.应用名称和数据库名称一致 2.javaBean类名称+s和数据库表名一致 3.返回一条数据时,变量名为javaBean类名称的小写;返回多条数据时,变量名为javaBean类名称的大写 4.jav ...
- POJ Georgia and Bob-----阶梯博弈变形。
Georgia and Bob Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 6622 Accepted: 1932 D ...
- WCF使用net.tcp传输文件
摘要:今天看了一些官方的资料和配置,简单写了一个WCF服务来传递一个文件,借此看看WCF传输大文件的能力,这里采用的是NetTcp绑定,之所以没有采用 basicHttpBinding是因为考虑这种方 ...