实现效果: 1. 当点击图片是放大,或者缩小
放大:
---实现方式:
Matrix matrix=new Matrix();
matrix.postScale(2.0f,2.0f);
newBitmap=Bitmap.createBitmap(bp, 0, 0, bp.getWidth(), bp.getHeight(), matrix, true);
缩小:
---实现方式:
Matrix matrix=new Matrix();
matrix.postScale(0.5f,0.5f);
newBitmap=Bitmap.createBitmap(bp, 0, 0, bp.getWidth(), bp.getHeight(), matrix, true);
最后:ImageView.setImageBitmap(newBitmap) ; //ImageView重新set bitmap