且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在kotlin android中将base64字符串转换为图像

更新时间:2023-11-15 19:49:46

您可以使用此代码进行解码:-

You can use this code to decode: -

val imageBytes = Base64.decode(base64String, Base64.DEFAULT)
val decodedImage = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length)
imageView.setImageBitmap(decodedImage)