Android 简单的图片缩放方法
2024-10-09 15:23:53
很简单的一个图片缩放方法,注意要比例设置正确否则可能会内存溢出
相关问题 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);
}
最新文章
- centos7安装图片界面
- mysql命令详解
- cuda并行计算的几种模式
- 树莓派3 安装ubuntu-mate
- Android 呼吸灯流程分析
- [端API] 控件在一个页面里open了,但其他页面打开这个控件怎么关闭
- SSO之CAS备忘
- Oracle数据块损坏的恢复实例
- /etc/postfix下 main.cf 配置文件详解
- Python之scrapy安装
- Docker基本架构
- JavaScript If…Else 语句
- ECharts使用:this.dom.getContext is not a function
- post上传和压缩、插件模拟请求
- Go语言学习笔记说明
- SSE图像算法优化系列二十二:优化龚元浩博士的曲率滤波算法,达到约1000 MPixels/Sec的单次迭代速度
- pandas shift
- [转] LINUX内核代码编程规范
- spring整合elasticsearch之环境搭建
- SGU---102 欧拉函数