ImageView.getMatrix()和ImageView.getImageMatrix()有什么区别? [英] What is the difference between ImageView.getMatrix() and ImageView.getImageMatrix()?

查看:101
本文介绍了ImageView.getMatrix()和ImageView.getImageMatrix()有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在不同的论坛上都看到过这个问题,但没人能回答.是getMatrix处理视图中图像的位置,而getImageMatrix处理图像相对于其自身的大小吗?

I've seen this question asked in different forums, but no one ever gave an answer. Does getMatrix deal with the images position within the view while getImageMatrix deals with the size of the image relative to itself?

文档内容如下:

Matrix getImageMatrix()

返回视图的可选矩阵.绘制时将其应用于视图的可绘制对象.如果没有矩阵,则此方法将返回一个单位矩阵.请勿在适当位置更改此矩阵,但要进行复制.如果要将其他矩阵应用于可绘制对象,请确保调用setImageMatrix().

Return the view's optional matrix. This is applied to the view's drawable when it is drawn. If there is no matrix, this method will return an identity matrix. Do not change this matrix in place but make a copy. If you want a different matrix applied to the drawable, be sure to call setImageMatrix().

.

Matrix getMatrix()

此视图的变换矩阵,是根据当前旋转,缩放和枢轴属性计算的.

The transform matrix of this view, which is calculated based on the current rotation, scale, and pivot properties.

推荐答案

getImageMatrix()返回用于处理 ImageView ,并在 ImageView 类中声明.

getMatrix() returns matrix that you can use to manipulate the view itself, translate, rotate, scaled or skew the view. It is method of View class. While getImageMatrix() returns matrix for manipulating drawable inside ImageView and it is declared in ImageView class.

这篇关于ImageView.getMatrix()和ImageView.getImageMatrix()有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆