我有一个表示位图图像的 Base64 字符串。
我需要再次将该字符串转换为位图图像,以便在我的 Android 应用程序的 ImageView 上使用它
怎么做?
最佳答案
您可以使用此代码进行解码:-
val imageBytes = Base64.decode(base64String, Base64.DEFAULT)
val decodedImage = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length)
imageView.setImageBitmap(decodedImage)
关于android - 如何在kotlin android中将base64字符串转换为图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58955434/