0
点赞
收藏
分享

微信扫一扫

base64显示到imageView上

艾米吖 2022-06-01 阅读 100

base64=“data:image/jpg;base64, /9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL”
把前缀截取后才能正常显示

String encodedImage=modifyInfoBean.getData().getCaptcha();
                    String substring = encodedImage.substring(22);
                    byte[] decodedString = Base64.decode(substring, Base64.DEFAULT);
                    Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
                    captchaIv.setImageBitmap(decodedByte)

base64显示到imageView上_html

​​https://tool.jisuapi.com/base642pic.html​​base64显示到imageView上_微信登录_02


举报

相关推荐

0 条评论