Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
83
rated 0 times [  90] [ 7]  / answers: 1 / hits: 26589  / 11 Years ago, thu, january 23, 2014, 12:00:00

I am developing a phonegap application here i got a byte array of a image form server and i want to display that byte array to image in html using javascript so can you help me to convert byte array to image format.


More From » jquery

 Answers
145

If you have the byte array first you convert it to Base64String and then you place it on an img tag like that (for png image)



<img src=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg== alt=Red dot>

[#72994] Wednesday, January 22, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ingridmikaylam

Total Points: 93
Total Questions: 81
Total Answers: 105

Location: Nicaragua
Member since Tue, Dec 8, 2020
4 Years ago
;