欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

getImageMatrix、getMatrix傻傻分不清

程序员文章站 2022-05-29 11:29:07
...

在使用ImageView做缩放的时候,调用setImagematrix设置矩阵参数;
那么设置完成之后,如何再获取到这个Matrix,有两个方法getImageMatrix()、getMatrix()不知道应该使用哪一个,通过查阅资料,打印日志发现,setImageMatrix与getImageMatrix应该是对应的;

10-22 09:12:38.766 28557-28557/ E/ImageViewDoodle: matrix,mScaleMatrix:Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]}
10-22 09:12:38.766 28557-28557/ E/ImageViewDoodle: matrix,getMatrix:Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]}
10-22 09:12:38.766 28557-28557/ E/ImageViewDoodle: matrix,getImageMatrix:Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]}

10-22 09:12:41.556 28557-28557/ E/ImageViewDoodle: matrix,mScaleMatrix:Matrix{[1.5954068, 0.0, -387.61136][0.0, 1.5954068, -300.9421][0.0, 0.0, 1.0]}
10-22 09:12:41.556 28557-28557/ E/ImageViewDoodle: matrix,getMatrix:Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]}
10-22 09:12:41.556 28557-28557/ E/ImageViewDoodle: matrix,getImageMatrix:Matrix{[1.5954068, 0.0, -387.61136][0.0, 1.5954068, -300.9421][0.0, 0.0, 1.0]}

10-22 09:12:44.016 28557-28557/ E/ImageViewDoodle: matrix,mScaleMatrix:Matrix{[2.061363, 0.0, -682.5592][0.0, 2.061363, -502.3898][0.0, 0.0, 1.0]}
10-22 09:12:44.016 28557-28557/ E/ImageViewDoodle: matrix,getMatrix:Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]}
10-22 09:12:44.016 28557-28557/ E/ImageViewDoodle: matrix,getImageMatrix:Matrix{[2.061363, 0.0, -682.5592][0.0, 2.061363, -502.3898][0.0, 0.0, 1.0]}

10-22 09:12:46.676 28557-28557/ E/ImageViewDoodle: matrix,mScaleMatrix:Matrix{[4.0, 0.0, -1881.3374][0.0, 4.0, -1432.1445][0.0, 0.0, 1.0]}
10-22 09:12:46.676 28557-28557/ E/ImageViewDoodle: matrix,getMatrix:Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]}
10-22 09:12:46.676 28557-28557/ E/ImageViewDoodle: matrix,getImageMatrix:Matrix{[4.0, 0.0, -1886.2542][0.0, 4.0, -1395.9482][0.0, 0.0, 1.0]}

资料:
资料一
资料二
还是得查源码来得靠谱啊,资料都是指向源码的;