Android Matrix API 列表:

  1. setTranslate(float dx, float dy):设置矩阵平移的值
  2. setScale(float sx, float sy):设置矩阵缩放的值
  3. setRotate(float degrees):设置矩阵旋转的角度
  4. setSkew(float kx, float ky):设置矩阵倾斜的值
  5. setConcat(Matrix a, Matrix b):将两个矩阵进行合并
  6. preTranslate(float dx, float dy):在矩阵平移之前进行预平移
  7. preScale(float sx, float sy):在矩阵缩放之前进行预缩放
  8. preRotate(float degrees):在矩阵旋转之前进行预旋转
  9. preSkew(float kx, float ky):在矩阵倾斜之前进行预倾斜
  10. postTranslate(float dx, float dy):在矩阵平移之后进行后平移
  11. postScale(float sx, float sy):在矩阵缩放之后进行后缩放
  12. postRotate(float degrees):在矩阵旋转之后进行后旋转
  13. postSkew(float kx, float ky):在矩阵倾斜之后进行后倾斜
  14. mapPoints(float[] dst, float[] src):将源点映射到目标点
  15. mapRect(RectF dst, RectF src):将源矩形映射到目标矩形

使用方法:

  1. 创建一个 Matrix 对象:Matrix matrix = new Matrix();
  2. 调用 Matrix 对象的 API 进行矩阵变换,例如:matrix.setTranslate(100, 200);
  3. 将变换应用到 View 上,例如:view.setImageMatrix(matrix)
列出 android Matrix 的api 列表和如何使用

原文地址: http://www.cveoy.top/t/topic/eH1b 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录