在使用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]}
资料:
资料一
资料二
还是得查源码来得靠谱啊,资料都是指向源码的;