Wednesday, February 12, 2014

matrix is ​​not also specify two different?


            
I think both the picture zoom, and pan, but specify two parameters, the parameters are specified after the effective, pre-specified parameter is invalid, is not only an effective matrix?
 

Matrix matrix = new Matrix ();
matrix.setTranslate (toLeft, toTop);
matrix.setScale (rateOfWidth * imgScale, rateOfWidth * imgScale);
canvas.drawBitmap (bmpOri, matrix, paint);



After that, the effective!
Reply:
Own answers and share

 

Matrix matrix = new Matrix ();
matrix.preScale (imgRateOfWidth * imgScale, imgRateOfWidth * imgScale);
matrix.postTranslate (-toLeft,-toTop);
canvas.drawBitmap (bmpOri, matrix, paint);



Into this just fine!
Reply:
This is a problem of dirty region

No comments:

Post a Comment