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来绘 ...
随机推荐
- (1)PyCharm开发工具安装Flask并创建helloworld程序
一.环境描述 1.操作系统:windows7 2.编程语言:python3.6 下载地址:https://www.python.org/downloads/windows/ 3.虚拟化环境:virtu ...
- linux列出当前目录下的所有的目录?
### 列出当前目录下的所有目录: [root@localhost ~]# ls -ld * #列出所有的文件 drwxr-xr-x. root root Nov : elasticsearch d ...
- Python3基础 sys.path 查看与修改导包的路径
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
- Appium脚本(2):元素检测
场景: 有的按钮在第一次打开时显示,之后就不显示了,如更新提示.特性介绍等,面对这样的场景写了如下脚本,增加脚本的复用性. no_element_exception_2.py from appium ...
- mysql使用yum源安装各个版本的mysql数据库
每次想用yum安装旧版本的mysql时,发现都找不到mysql的yum安装源,在官网只能找到最新版本mysql的yum源.后来才知道,原来最新的mysql的yum源也是包含了旧版本的mysql的yum ...
- [LeetCode] 253. Meeting Rooms II 会议室 II
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si ...
- Linux下Python安装PyMySQL成功,但无法导入的问题
今天使用 Nginx 部署 Django应用.安装python库都显示成功安装. 尝试启动 uwsgi 服务,竟然报错 Traceback (most recent call last): File ...
- Worker Thread模式
工人线程Worker thread会逐个取回工作并进行处理,当所有工作全部完成后,工人线程会等待新的工作到来 5个工人线程从传送带取数据,3个传送工人线程将数据放入传送带 public class C ...
- 顺序表习题(1)-打印非递减数组a与b的升序并集(去除重复元素)
void Print_Union(SqList a,SqList b) { , q = ; //初始化指针 ; //记录上一次打印的元素 while (p!=a.length&&q!= ...
- centos发布 7.7.1908版本了,怎么把老版本更新到新版本了?
CENTOS升级 7.6 升级到7.7.1908 0.查看目前版本 cat /etc/issue cat /etc/redhat-release 1.下载系统镜像文件 https://www.cent ...