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. ngxtop安装和使用

    监控nginx的请求信息,总共收到了多少个请求,有哪些成功的,有哪些失败的 ngxtop安装 1.安装python-pip 1) yum install epel-release 出现如下错误:No ...

  2. Python | Pipenv官方推荐的python包管理工具

    原文地址:https://cloud.tencent.com/developer/article/1355672 Pipenv - 官方推荐的的python包管理工具. Pipenv是一款旨在将所有包 ...

  3. electron---项目打包

    创建一个应用目录:app,里面需要有必要的三个文件: index.html <!DOCTYPE html> <html> <head> <meta chars ...

  4. RequestUtil 获取网址页面信息

    import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.i ...

  5. [LeetCode] 60. Permutation Sequence 序列排序

    The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the p ...

  6. [LeetCode] 305. Number of Islands II 岛屿的数量 II

    A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand oper ...

  7. [LeetCode] 496. Next Greater Element I 下一个较大的元素 I

    You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of n ...

  8. python:校验邮箱格式

    # coding:utf-8 import re def validateEmail(email): if re.match("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\ ...

  9. 【Python开发】【编程开发】各种系统的清屏操作命令

    mac os x terminal清屏快捷键 cammand+k linux系统清屏快捷键 ctrl+l linux系统命令行清屏命令 clear windows 命令行清屏命令 cls Matlab ...

  10. ubuntu16.04+cuda9.0_cudnn7.5+tensorflow-gpu==1.12.0

    1.查找可用的tensorflow源,该命令运行后终端会输出所有可用的源 anaconda search -t conda tensorflow 2.这里name是上一步中输出源的tensorflow ...