使用javascript将base64字符串转换为图像 [英] convert base64 string to image with javascript
本文介绍了使用javascript将base64字符串转换为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Titanium开发应用程序。我需要将我从JSON获得的base64字符串转换为图像。
Am developing an application with Titanium. I need to convert base64 string which i would be getting from JSON to an image.
非常感谢您的帮助。
推荐答案
您可以创建 img
元素并更改其 src
使用所需数据:
You can just create an img
element and change its src
with the required data:
<img src="data:image/png;base64,iVBORw0KGgoAAAANS..." />
这篇关于使用javascript将base64字符串转换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文