//将byte[]类型转换成Bitmap类型
byte[] b = getIntent().getByteArrayExtra("bitmap");
Bitmap bitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
//Bitmap转换成byte[]
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] datas = baos.toByteArray();
Android Bitmap对象与byte[]相互转换
最新推荐文章于 2024-07-09 21:52:34 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)