Code example for Matrix

Methods: invert

0
	 * On draw mode changed. 
	 */ 
	protected void onDrawModeChanged() { 
		if ( mTouchMode == TouchMode.DRAW ) {
 
			Matrix m1 = new Matrix( getImageMatrix() );
			mInvertedMatrix.reset();
 
			float[] v1 = getMatrixValues( m1 );
			m1.invert( m1 );
			float[] v2 = getMatrixValues( m1 );
 
			mInvertedMatrix.postTranslate( -v1[Matrix.MTRANS_X], -v1[Matrix.MTRANS_Y] );
			mInvertedMatrix.postScale( v2[Matrix.MSCALE_X], v2[Matrix.MSCALE_Y] );
			mCanvas.setMatrix( mInvertedMatrix );
 
			mCurrentScale = getScale();
 
			mPaint.setStrokeWidth( mBrushSize );
		} 
	}