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笔记(变换)的更多相关文章

  1. Core Animation笔记(动画)

    一.隐式动画 layer默认开启隐式动画 禁用隐式动画 [CATransaction setDisableActions:true]; 设置隐士动画时间 //默认0.25s [CATransactio ...

  2. Core Animation笔记(特殊图层)

    1.shapeLayer: 渲染快速,内存占用小,不会被图层边界裁掉(可以在边界之外绘制),不会像素化(当做3D变化如缩放是不会失真) CGRect rect = self.containerView ...

  3. Core Animation笔记(- Layer 基本属性)

    一.Layer的基本属性 1. contents 图层内容默认为nil 可以指定一张图片作为内容展示 self.layerView.layer.contents = (__bridge id)imag ...

  4. IOS Core Animation Advanced Techniques的学习笔记(四)

    第五章:Transforms   Affine Transforms   CGAffineTransform是二维的     Creating a CGAffineTransform   主要有三种变 ...

  5. IOS Core Animation Advanced Techniques的学习笔记(一)

    转载. Book Description Publication Date: August 12, 2013 Core Animation is the technology underlying A ...

  6. IOS Core Animation Advanced Techniques的学习笔记(五)

    第六章:Specialized Layers   类别 用途 CAEmitterLayer 用于实现基于Core Animation粒子发射系统.发射器层对象控制粒子的生成和起源 CAGradient ...

  7. Core Animation学习总结

    文件夹: The Layer Beneath The Layer Tree(图层树) The Backing Image(寄宿层) Layer Geometry(图层几何学) Visual Effec ...

  8. iOS——Core Animation 知识摘抄(四)

    原文地址http://www.cocoachina.com/ios/20150106/10840.html 延迟解压 一旦图片文件被加载就必须要进行解码,解码过程是一个相当复杂的任务,需要消耗非常长的 ...

  9. iOS——Core Animation 知识摘抄(三)

    原文地址:http://www.cocoachina.com/ios/20150105/10827.html CAShapeLayer CAShapeLayer是一个通过矢量图形而不是bitmap来绘 ...

随机推荐

  1. gdal 根据条件选择数据

  2. Python模块安装方法

    安装Python模块 电子邮件 distutils-sig @ python .组织 作为一个受欢迎的开源开发项目,Python具有活跃的贡献者和用户支持社区,并且根据开放源代码许可条款,其软件可供其 ...

  3. CEF 访问需要认证网页或接口(在Request的Headers中添加认证Token)

    转载:https://blog.csdn.net/wdw984/article/details/85275289 1.首先要让我们自己的CefClient这个类公有继承CefRequestHandle ...

  4. Oracle系列三 过滤和排序

    WHERE子句 使用WHERE 子句,将不满足条件的行过滤掉. 示例: SELECT employee_id, last_name, job_id, department_id FROM employ ...

  5. 2-5 【ngFor指令 事件的处理和样式绑定】顶部导航支持选中状态

    索引的获取 first和last是布尔类型的 奇数偶数 []方括号表示的是数据绑定 ()圆括号就是事件绑定 . 开始代码 我们要实现的功能是菜单点击后,就变色 这样我们就得到了索引. 新建一个clas ...

  6. Swift编码总结5

    1.UIWindow属性: 1>.- (void)becomeKeyWindow;                               // override point for sub ...

  7. 【linux基础err】bash: cannot create temp file for here-document: No space left on device

    博主的device还有剩余空间也出现了这个问题,不知是什么原因,不过删除一些无用的内容,或者将某些有用的内容移动到其他硬盘,之后就可以正常使用了. 参考: 1. cannot create temp ...

  8. [LeetCode] 264. Ugly Number II 丑陋数 II

    Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors ...

  9. Linux安装卸载JDK完整步骤

    1.检查一下系统中的jdk版本 [root@localhost software]# java -version 显示: openjdk version "1.8.0_102" O ...

  10. 用js实现promise

    /*       自定义promise         1. 执行MyPromise构造函数,要立即执行executor         2. promise实例对象,内部有三种状态          ...