Core Animation笔记(变换)
1.仿射变换
CGAffineTransformMakeScale :
CGAffineTransformMakeTranslation
CGAffineTransformMakeRotation(CGFloat angle)
CGAffineTransform scaleTrans = CGAffineTransformMakeScale(1.2, 1.2);
CGAffineTransform tanslation = CGAffineTransformMakeTranslation(, );
//复合两个变换受,第二个受到第一个影响,所以这里位移小于100
CGAffineTransform compact = CGAffineTransformConcat(scaleTrans, tanslation
self.imgView.layer.affineTransform = compact;
//生成一个初始化的空值 单位矩阵
CGAffineTransform indentity = CGAffineTransformIdentity;
indentity = CGAffineTransformRotate(indentity, M_PI/);
//这里是右移 但实际效果是左移动,因为在之前做个旋转变换,上个变换会影响到下个变换,也就是说位移变换也要旋转90度相当于向左移!
indentity = CGAffineTransformTranslate(indentity, , ) ;
self.imgView.layer.affineTransform = indentity;
2.3D 效果
//透视效果
CATransform3D indentity3d = CATransform3DIdentity;
//设置m34来设置透视效果(看上去有立体感)
indentity3d.m34 = -1.0/;
indentity3d = CATransform3DRotate(indentity3d, M_PI/, , , );
self.imgView.layer.transform = indentity3d;
//是否绘制背面图形,默认YES 即图层的背面是正面的镜像
self.imgView.layer.doubleSided = true; //为子类图层添加变换
self.containerView.layer.sublayerTransform = indentity3d;
Core Animation笔记(变换)的更多相关文章
- Core Animation笔记(动画)
一.隐式动画 layer默认开启隐式动画 禁用隐式动画 [CATransaction setDisableActions:true]; 设置隐士动画时间 //默认0.25s [CATransactio ...
- Core Animation笔记(特殊图层)
1.shapeLayer: 渲染快速,内存占用小,不会被图层边界裁掉(可以在边界之外绘制),不会像素化(当做3D变化如缩放是不会失真) CGRect rect = self.containerView ...
- Core Animation笔记(- Layer 基本属性)
一.Layer的基本属性 1. contents 图层内容默认为nil 可以指定一张图片作为内容展示 self.layerView.layer.contents = (__bridge id)imag ...
- IOS Core Animation Advanced Techniques的学习笔记(四)
第五章:Transforms Affine Transforms CGAffineTransform是二维的 Creating a CGAffineTransform 主要有三种变 ...
- IOS Core Animation Advanced Techniques的学习笔记(一)
转载. Book Description Publication Date: August 12, 2013 Core Animation is the technology underlying A ...
- IOS Core Animation Advanced Techniques的学习笔记(五)
第六章:Specialized Layers 类别 用途 CAEmitterLayer 用于实现基于Core Animation粒子发射系统.发射器层对象控制粒子的生成和起源 CAGradient ...
- Core Animation学习总结
文件夹: The Layer Beneath The Layer Tree(图层树) The Backing Image(寄宿层) Layer Geometry(图层几何学) Visual Effec ...
- iOS——Core Animation 知识摘抄(四)
原文地址http://www.cocoachina.com/ios/20150106/10840.html 延迟解压 一旦图片文件被加载就必须要进行解码,解码过程是一个相当复杂的任务,需要消耗非常长的 ...
- iOS——Core Animation 知识摘抄(三)
原文地址:http://www.cocoachina.com/ios/20150105/10827.html CAShapeLayer CAShapeLayer是一个通过矢量图形而不是bitmap来绘 ...
随机推荐
- Redis慢日志查询
Redis slowlog 是个什么 redis的slow log记录了那些执行时间超过规定时长的请求.执行时间不包括I/O操作(比如与客户端进行网络通信等),只是命令的实际执行时间(期间线程会被阻塞 ...
- postgresql - relation 权限相关问题
GRANT ALL PRIVILEGES ON DATABASE 数据库.[schema] TO [用户名]; GRANT ALL ON schema [schema] TO [用户名]; GRANT ...
- 小数末尾是0的,不显示0,有值才显示 StringFormat
JAVA public static void main(String[] args) { DecimalFormat df = new DecimalFormat("###.##" ...
- k8s记录-yum本地仓库部署
#1.安装插件yum install -y yum-plugin-downloadonly createrepo rsync #2.创建仓库目录mkdir -p /mirrors/centos#3.下 ...
- jxls:用jx:if实现字典值格式化
用JXLS导出excel非常方便,但是我们往往需要把字典值转为中文名称,例如1转为男,这个时候就需要用到jx:if来完成. 请见下图: jx:if(condition="obj.way==1 ...
- [LeetCode] 445. Add Two Numbers II 两个数字相加之二
You are given two linked lists representing two non-negative numbers. The most significant digit com ...
- Redis哨兵(Sentinel)模式
Redis哨兵(Sentinel)模式 主从切换技术的方法是:当主服务器宕机后,需要手动把一台从服务器切换为主服务器,这就需要人工干预,费事费力,还会造成一段时间内服务不可用.这不是一种推荐的方式 ...
- odoo - 自定义默认主页
- 18 Ajax、Json以及jackson框架解析json的基本应用
1. Ajax (1)概念:ASynchronous JavaScript And XML 异步的JavaScript 和 XML 异步和同步:客户端和服务器端相互通信的基础上 * 客户端必须等待服务 ...
- 《PHP - 信号/基本操作/配置》
一:PHP 信号 - SIGINT / SIGTERM / SIGQUIT - 退出FPM,在master收到退出信号后将向所有的worker进程发送退出信号,然后master退出. - SIGUSR ...