开发者

how to display images which are stored as string array in html?

I have been trying to load images which are in database(on local phone) .JSON talks to java and gets the byte array which i am encoding as 64 bit data and returns a string array . Now i am trying to parse the json data. I see the array but how do i read it or set it image tag in html . All answers are ap开发者_如何学编程preciated


Use the data:// URI scheme.

For example, if the base64-encoded data is:

iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==

then you'd drop that data into an image's src attribute like so:

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

which draws this image:

how to display images which are stored as string array in html?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜