android 图片放大缩小

引用:http://blog.163.com/itsmallbird@126/blog/static/1691391092011314105439501/

 private static Bitmap big(Bitmap bitmap) {
  Matrix matrix = new Matrix(); 
  matrix.postScale(1.5f,1.5f); //长和宽放大缩小的比例
  Bitmap resizeBmp = Bitmap.createBitmap(bitmap,0,0,bitmap.getWidth(),bitmap.getHeight(),matrix,true);
  return resizeBmp;
 }

 private static Bitmap small(Bitmap bitmap) {
  Matrix matrix = new Matrix(); 
  matrix.postScale(0.8f,0.8f); //长和宽放大缩小的比例
  Bitmap resizeBmp = Bitmap.createBitmap(bitmap,0,0,bitmap.getWidth(),bitmap.getHeight(),matrix,true);
  return resizeBmp;
 }

posted @ 2012-07-12 00:24  镇水古月  阅读(205)  评论(0编辑  收藏  举报