根据Matrix值获取图片位置信息

来源:互联网 发布:游族网络借壳上市 编辑:程序博客网 时间:2024/05/20 01:37
                            Rect rectTemp = mainView.getDrawable().getBounds();                             float[] values = new float[9];                             matrix.getValues(values);                             int leftPosition=(int)values[2];                            int rightPosition=(int)(values[2]+rectTemp.width()*values[0]);                            int widthValue=panImage.getBoundBox().getWidth();                            LogTag.d("z", "Left===>"+leftPosition);                            LogTag.d("z", "Right===>"+rightPosition);                            LogTag.d("z","width===>"+widthValue);//                            mainView.setImageMatrix(matrix);                            if(leftPosition>100&&deltaX>0){                            PanImageView.this.getParent().requestDisallowInterceptTouchEvent(false);                            return false;                            }                            if(rightPosition<widthValue-100&&deltaX<0){                            PanImageView.this.getParent().requestDisallowInterceptTouchEvent(false);                            return false;                            }