Code example for Matrix

Methods: postScale, postTranslate, setScale

0
        // Zoom out to at most 1x. 
        Matrix tmp = new Matrix(mSuppMatrix);
        tmp.postScale(1F / rate, 1F / rate, cx, cy);
 
        if (getScale(tmp) < 1F) {
            mSuppMatrix.setScale(1F, 1F, cx, cy);
        } else { 
            mSuppMatrix.postScale(1F / rate, 1F / rate, cx, cy);
        } 
        setImageMatrix(getImageViewMatrix());
        center(true, true); 
    } 
 
    protected void postTranslate(float dx, float dy) {
        mSuppMatrix.postTranslate(dx, dy);
    } 
 
    protected void panBy(float dx, float dy) {
        postTranslate(dx, dy);
        setImageMatrix(getImageViewMatrix());
    }