Matrix.postScale

 1   Matrix matrix = new Matrix();
 2             
 3             // 缩放图片动作
 4             matrix.postScale(scaleWidth, scaleHeight);
 5          // 创建新的图片
 6             Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0,
 7             width, height, matrix, true);
 8          
 9            i1.setImageBitmap(resizedBitmap);
10 
11   // 缩放图片动作
12             matrix.postScale(scaleWidth2, scaleHeight2);
13 // 创建新的图片
14           resizedBitmap = Bitmap.createBitmap(bitmapOrg2, 0, 0,
15             width2, height2, matrix, true);
16          
17            i2.setImageBitmap(resizedBitmap);

宽度上面会跟i1缩放的一样。
如果new一个新的Matrix作用在imageview2上面得到的效果会是正确的。why?

posted @ 2012-10-18 11:16  Atlas's blog  阅读(19531)  评论(0编辑  收藏  举报