
String 怎么转换为bitmap呢? 安卓 and java 5
ByteArrayOutputStreamstream=newByteArrayOutputStream();photo.compress(Bitmap.Compress...
ByteArrayOutputStream stream = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.JPEG, 60, stream);//压缩图片
byte[] b = stream.toByteArray();
// 将图片流以字符串形式存储下来
String tp = new String(Base64Coder.encodeLines(b));
我想把这个过程逆向为String 转换成bitmap,该怎么写呢? 展开
photo.compress(Bitmap.CompressFormat.JPEG, 60, stream);//压缩图片
byte[] b = stream.toByteArray();
// 将图片流以字符串形式存储下来
String tp = new String(Base64Coder.encodeLines(b));
我想把这个过程逆向为String 转换成bitmap,该怎么写呢? 展开
2个回答
2014-05-17
展开全部
先将String转成byte[],然后
bitmap = BitmapFactory.decodeByteArray(bitmapArray, 0,
bitmapArray.length);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询