android中Bitmap的放大和缩小实例代码
时间:2021-10-01 13:23:28
/**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;
}
标签:android,Bitmap,放大,缩小
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
使用SpringBoot发送邮件的方法详解
2023-01-30 02:21:37
![](https://img.aspxhome.com/file/2023/7/73107_0s.webp)
java8 stream自定义分组求和并排序的实现
2022-09-12 04:08:26
![](https://img.aspxhome.com/file/2023/5/79175_0s.png)
利用Java写一个学生管理系统
2023-09-24 17:06:54
![](https://img.aspxhome.com/file/2023/1/61071_0s.jpg)
C#实现基于XML配置MenuStrip菜单的方法
2023-03-06 21:48:50
![](https://img.aspxhome.com/file/2023/4/84494_0s.png)
Android自定义View 实现水波纹动画引导效果
2022-04-16 17:47:10
![](https://img.aspxhome.com/file/2023/7/122127_0s.gif)
Java中ArrayList与顺序表的概念与使用实例
2023-01-09 03:50:30
![](https://img.aspxhome.com/file/2023/2/73092_0s.png)
springboot中项目启动时实现初始化方法加载参数
2023-08-31 06:00:40
![](https://img.aspxhome.com/file/2023/0/80250_0s.png)
利用Spring Boot操作MongoDB的方法教程
2023-11-29 11:14:27
![](https://img.aspxhome.com/file/2023/5/60595_0s.jpg)
Java如何将ResultSet结果集遍历到List中
2022-07-01 06:30:46
![](https://img.aspxhome.com/file/2023/7/83097_0s.jpg)
Java开发实现人机猜拳游戏
2023-10-17 16:01:35
![](https://img.aspxhome.com/file/2023/9/61149_0s.jpg)
浅谈Spring Boot 整合ActiveMQ的过程
2022-03-22 05:20:27
使用异步方式调用同步方法(实例详解)
2023-03-29 16:38:21
解决springcloud 配置gateway 出现错误的问题
2023-12-04 00:45:49
![](https://img.aspxhome.com/file/2023/7/79957_0s.png)
C#实现文件与字符串互转的方法详解
2023-04-26 03:18:12
![](https://img.aspxhome.com/file/2023/2/70402_0s.png)
Android Studio Menu选择菜单的建立方法
2023-07-28 03:46:31
![](https://img.aspxhome.com/file/2023/4/85454_0s.png)
C#限速下载网络文件的方法实例
2023-07-01 01:33:15
![](https://img.aspxhome.com/file/2023/3/104323_0s.jpg)
spring缓存自定义resolver的方法
2021-05-30 17:07:56
![](https://img.aspxhome.com/file/2023/9/76259_0s.png)
浅谈c++11线程的互斥量
2023-02-14 18:00:44
![](https://img.aspxhome.com/file/2023/6/116586_0s.png)
C#表达式树Expression动态创建表达式
2023-03-26 06:44:39
Java递归实现迷宫游戏
2023-08-26 07:33:16
![](https://img.aspxhome.com/file/2023/2/63302_0s.png)