byte[] bitmapArray = Base64.decode(string.split(",")[1], Base64.DEFAULT);
bitmap = BitmapFactory.decodeByteArray(bitmapArray, 0, bitmapArray.length);
ps:需要去掉字符串中的“data:image/png;base64”
byte[] bitmapArray = Base64.decode(string.split(",")[1], Base64.DEFAULT);
bitmap = BitmapFactory.decodeByteArray(bitmapArray, 0, bitmapArray.length);
ps:需要去掉字符串中的“data:image/png;base64”
本文标题:Android 中 Base64 转换成图片
本文链接:https://www.haomeiwen.com/subject/ccrrvqtx.html
网友评论