Android Question Load base64 image into ImageView

uniplan

Active Member
Licensed User
Hi, i have base64 image string and i want to load into ImageView.
How i can do it?
Thnak you
 

DonManfred

Expert
Licensed User
Convert the base64 to a bytearray. Create a bitmap from this bytearray. Put this bitmap into the imageview.
 
Upvote 0

uniplan

Active Member
Licensed User
Thank you...i just follow this mode, but how i can put the bitmap into imageview?
now i create a html code with image tag and put into webview.
 
Upvote 0

MohammadNew

Active Member
Licensed User
Hi, i have base64 image string and i want to load into ImageView.
How i can do it?
Thnak you

you need library StringUtils

B4X:
Dim buffer() As Byte
Dim b As Bitmap
Dim su As StringUtils                
buffer = su.DecodeBase64(put here your source base64 image string)
Dim In As InputStream
In.InitializeFromBytesArray(buffer, 0, buffer.Length)
b.Initialize2(In)
ImageView1.Bitmap = b
 
Upvote 0
Top