很简单的一个图片缩放方法,注意要比例设置正确否则可能会内存溢出

相关问题 java.lang.IllegalArgumentException: bitmap size exceeds 32bits 可查看 http://blog.csdn.net/zhouzme/article/details/21732095

    public static Bitmap scale(Bitmap bitmap, float scaleWidth, float scaleHeight) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);
Log.i(TAG, "scaleWidth:"+ scaleWidth +", scaleHeight:"+ scaleHeight);
return Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
}

最新文章

  1. centos7安装图片界面
  2. mysql命令详解
  3. cuda并行计算的几种模式
  4. 树莓派3 安装ubuntu-mate
  5. Android 呼吸灯流程分析
  6. [端API] 控件在一个页面里open了,但其他页面打开这个控件怎么关闭
  7. SSO之CAS备忘
  8. Oracle数据块损坏的恢复实例
  9. /etc/postfix下 main.cf 配置文件详解
  10. Python之scrapy安装
  11. Docker基本架构
  12. JavaScript If…Else 语句
  13. ECharts使用:this.dom.getContext is not a function
  14. post上传和压缩、插件模拟请求
  15. Go语言学习笔记说明
  16. SSE图像算法优化系列二十二:优化龚元浩博士的曲率滤波算法,达到约1000 MPixels/Sec的单次迭代速度
  17. pandas shift
  18. [转] LINUX内核代码编程规范
  19. spring整合elasticsearch之环境搭建
  20. SGU---102 欧拉函数

热门文章

  1. windows服务1053错误排查
  2. jQuery实现鼠标移上弹出提示框,移出消失
  3. Aliexpress API 测试工具
  4. JavaScript判断对象的类型
  5. Myeclipse新建 配置Hibernate
  6. SQL Server 如何读写数据
  7. IOS Objective-C 协议,委托
  8. strut2读源码记录
  9. 2016年美国数学建模比赛(MCM/ICM) E题环境科学 Are we heading towards a thirsty planet? 人工精准翻译。
  10. 关于SQL 数据表中的密码加密