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. flask 开发用户登录注册功能

    flask 开发用户登录注册功能 flask开发过程议案需要四个模块:html页面模板.form表单.db数据库操作.app视图函数 1.主程序 # app.py # Auther: hhh5460 ...

  2. mariadb使用with子句重写SQL性能提升5倍

    几个月前,我们有个产品的开发反馈了个问题,说有个组织结构的查询很慢,几千行的复杂关联需要1秒钟,表示太慢了,原语句如下: SELECT org.org_id, org.dimension, org.o ...

  3. git让线上代码强制覆盖本地的

    git强制覆盖本地命令(分步执行): git fetch --all    git reset --hard origin/master    git pull git强制覆盖本地命令(单条执行):  ...

  4. 系统运维工程师装逼完全指南(转载Mark)

    1.全球化的认证有助于提升逼格,什么OCM.CCIE.RHCA.CISSP等等能考都考,再不济,也要有一张系统架构设计师或者网络规划设计师的信产部认证.每过一个认证,逼格提升一档. 2.TCP/IP协 ...

  5. Anaconda无法更新

    在安装完Anaconda,更新包时 C:\Users\Administrator>conda upgrade --all WARNING: The conda.compat module is ...

  6. (生鲜项目)01. Vue环境搭建

    第一步: nodejs安装 https://nodejs.org/en/download/ 说明安装成功 第二步: cnpm 由于npm需要很多的依赖包,这些包下载都很慢,所以就有了cnpm : ht ...

  7. 自动化运维工具之SaltStack简介与安装

    1.SaltStack简介 官方网址:http://www.saltstack.com官方文档:http://docs.saltstack.comGitHub:https:github.com/sal ...

  8. 用vue实现列表分页和按钮操作

    为中华之崛起而读书 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> < ...

  9. C#中数组、集合(ArrayList)、泛型集合List<T>、字典(dictionary<TKey,TValue>)全面对比

    C#中数组.集合(ArrayList).泛型集合List<T>.字典(dictionary<TKey,TValue>)全面对比 为什么把这4个东西放在一起来说,因为c#中的这4 ...

  10. LeetCode 103. 二叉树的锯齿形层次遍历(Binary Tree Zigzag Level Order Traversal)

    103. 二叉树的锯齿形层次遍历 103. Binary Tree Zigzag Level Order Traversal 题目描述 给定一个二叉树,返回其节点值的锯齿形层次遍历.(即先从左往右,再 ...