How can I convert base64 to bitmap in Android

前端 未结 1 1500
庸人自扰
庸人自扰 2021-01-14 07:20

I want to take a byte array decoded from base64 and show it on an ImageView in Android.

I fetch the byte array from the database:

 byte[] blob = c.g         


        
相关标签:
1条回答
  • 2021-01-14 07:41

    The data you posted, seems to be corrupted. Decoding it (using the base64 command line utility`) produces something that looks like a PNG file, but not really:

    $ base64 -d input.txt > output.png
    $ file output.png 
    output.png: PNG image, 805314562 x 284378236, 0-bit grayscale,
    $
    
    0 讨论(0)
提交回复
热议问题