close
重點是img src要加上data:image/jpg;base64,,後面再接base64編碼的圖片檔。
<img src="data:image/jpg;base64," + base64code>
--
<div>
<p>Taken from wikpedia</p>
<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />
</div>
--
參考 https://stackoverflow.com/questions/8499633/how-to-display-base64-images-in-html
--
全站熱搜
留言列表