android中Bitmap的放大和缩小的方法

时间 2013-06-20 19:02:34 CSDN博客 原文http://blog.csdn.net/ada168855/article/details/9139777

/**Bitmap放大的方法*/

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;
}

/**Bitmap缩小的方法*/

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;
}

更多相关文章

  1. Android遍历文件Listfile返回值为null问题解决方法适用Android8.
  2. Android 最新获取手机内置存储大小,SD卡存储空间大小方法
  3. Android 启动浏览器的方法
  4. Android根据电量变化为不同图片的方法【电池电量提示】
  5. Android之日期时间选择器使用方法
  6. Android 图片旋转(使用Matrix.setRotate方法)
  7. Android Http请求失败解决方法
  8. Glide的with()方法和生命周期的源码分析
  9. android TelephonyManager类的方法

随机推荐

  1. How to add a new keycode in android
  2. 搞定 Android(安卓)布局2:SlidingPaneLayo
  3. Android(安卓)app设置全屏模式
  4. Android(安卓)控件xml属性详解
  5. Android编译过程详解(一)
  6. Android设备功能之传感器教程篇
  7. cocos2d-x & Android(安卓)环境配置笔记
  8. Android:inputType常用取值
  9. Android中控件的隐藏和显示
  10. 由Android想到的事情