Matrix使用简介
来源:互联网 发布:epub转azw3软件 编辑:程序博客网 时间:2024/05/23 00:08
voidsetRotate(float degrees)
Set the matrix to rotate about (0,0) by the specified number of degrees.
voidsetRotate(float degrees, float px, float py)Set the matrix to rotate by the specified number of degrees, with a pivot point at (px, py).
围绕点px, py 旋转 degrees度, 如果没设置坐标,默认以0,0点旋转.
缩放,翻转
voidsetScale(float sx, float sy)
Set the matrix to scale by sx and sy.
voidsetScale(float sx, float sy, float px, float py)Set the matrix to scale by sx and sy, with a pivot point at (px, py).
以点px,py为原点缩放 >=0 1为正常大小
如果是负数,图形就会翻转
如果没设置原点坐标,默认以0,0点缩放(如果发现图片不见了,检查一下是不是翻转出了屏幕)
例子:setScale(-0.5f, 1,180, 120); //左右翻转并缩放到一半大小
倾斜
voidsetSkew(float kx, float ky, float px, float py)
Set the matrix to skew by sx and sy, with a pivot point at (px, py).
voidsetSkew(float kx, float ky)Set the matrix to skew by sx and sy.
以点px,py为原点倾斜如果没有设置原点,则以0,0点为原点.
坐标
voidsetTranslate(float dx, float dy)Set the matrix to translate by (dx, dy).
是图片移动到某一个位置
注意
Matrix中带有pre, post的函数需要考虑先后顺序
例如:想要旋转45度,然后平移到100,100的位置需要
- Matrix matrix = new Matrix();
- matrix.postRotate(45);
- matrix.postTranslate(100, 100);
或者
- Matrix matrix = new Matrix();
- matrix.setTranslate(100, 100);
- matrix.preRotate(45);
- Matrix使用简介
- Matrix 简介
- Matrix使用
- Matrix 使用
- Android的Matrix类简介
- 使用Matrix设置字体
- android Matrix的使用。。。
- Android 使用Matrix实例
- android matrix&colormatrix 使用
- 如何使用Gizmos.matrix
- Matrix 移动的使用
- draw(),matrix简单使用
- 使用Matrix倾斜图像
- 使用Matrix平移图像
- Matrix使用解析
- Bitmap、Matrix使用
- Android Matrix使用总结
- Matrix使用解析
- 观察者模式
- Median of Two Sorted Arrays
- Android上dip、dp、px、sp等单位说明
- 异步FIFO 忙闲标志
- OOM讲课内容:图片缓存
- Matrix使用简介
- android换肤
- 使用hadoop和hive来进行应用的日志数据分析
- 移动互联网产品设计的五个核心要素
- Linux中报找不到xxx.so时的解决办法
- JavaScript+技巧与高级特性
- noBackend:前端优先的开发模式
- oracle数据字典及视图
- PDF添加书签