[翻译] 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:)

目录
相关文章
|
传感器 数据处理 C语言
单片机:微小却强大的计算机世界
单片机:微小却强大的计算机世界
|
域名解析 网络协议 Ubuntu
dig 命令深入学习
dig 命令(Domain Information Groper)是一个用于查询 DNS (域名系统)记录的强大工具,它提供了详细的DNS信息,主要用于帮助用户诊断、调试和验证与域名解析相关的问题。
|
机器学习/深度学习 人工智能 Serverless
👉「免费满血DeepSeek实战-联网搜索×Prompt秘籍|暨6平台横评」
满血 DeepSeek 免费用!支持联网搜索!创作声明:真人攥写-非AI生成,Written-By-Human-Not-By-AI
6954 11
👉「免费满血DeepSeek实战-联网搜索×Prompt秘籍|暨6平台横评」
|
自然语言处理 JavaScript 开发者
通义灵码插件:VSCode 的智能编程助手
通义灵码插件:VSCode 的智能编程助手
14573 5
|
中间件
Cmake快速入门
Cmake快速入门
204 0
|
分布式计算 Spark
【Spark】(五)Spark Transformation(转换算子) 和 Action(执行算子)2
【Spark】(五)Spark Transformation(转换算子) 和 Action(执行算子)2
259 0
【Spark】(五)Spark Transformation(转换算子) 和 Action(执行算子)2
|
5天前
|
缓存 人工智能 自然语言处理
我对比了8个Claude API中转站,踩了不少坑,总结给你
本文是个人开发者耗时1周实测的8大Claude中转平台横向评测,聚焦Claude Code真实体验:以加权均价(¥/M token)、内部汇率、缓存支持、模型真实性及稳定性为核心指标。
2120 11
|
22天前
|
人工智能 数据可视化 安全
王炸组合!阿里云 OpenClaw X 飞书 CLI,开启 Agent 基建狂潮!(附带免费使用6个月服务器)
本文详解如何用阿里云Lighthouse一键部署OpenClaw,结合飞书CLI等工具,让AI真正“动手”——自动群发、生成科研日报、整理知识库。核心理念:未来软件应为AI而生,CLI即AI的“手脚”,实现高效、安全、可控的智能自动化。
34935 57
王炸组合!阿里云 OpenClaw X 飞书 CLI,开启 Agent 基建狂潮!(附带免费使用6个月服务器)
|
17天前
|
人工智能 自然语言处理 安全
Claude Code 全攻略:命令大全 + 实战工作流(建议收藏)
本文介绍了Claude Code终端AI助手的使用指南,主要内容包括:1)常用命令如版本查看、项目启动和更新;2)三种工作模式切换及界面说明;3)核心功能指令速查表,包含初始化、压缩对话、清除历史等操作;4)详细解析了/init、/help、/clear、/compact、/memory等关键命令的使用场景和语法。文章通过丰富的界面截图和场景示例,帮助开发者快速掌握如何通过命令行和交互界面高效使用Claude Code进行项目开发,特别强调了CLAUDE.md文件作为项目知识库的核心作用。
15374 44
Claude Code 全攻略:命令大全 + 实战工作流(建议收藏)

热门文章

最新文章

下一篇
开通oss服务