渲染存储在DB中的图像作为html控件上的字节数组 [英] render images stored in DB as byte array on html control
本文介绍了渲染存储在DB中的图像作为html控件上的字节数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我在SQL DB中存储用图像创建的注释。
html存储为字符串,如此
例如:
Hello,
I am storing a note created with images in my SQL DB.
The html is stored as string like so
eg:
<div class="WordSection1">
Image 1<br>
<img width="237" height="97" id="Picture_x0020_2" src="cid:image001.png"><br></div>
image0001.png的内容存储为字节数组。
如何显示带有显示图像的注释
现在它显示一个'X',图像应该是
请协助。谢谢
And the content of image0001.png is stored as a byte array.
how do I display the note with the image displayed
right now it displays a 'X' where the image should be
Please assist. Thanks
推荐答案
GOt it ..
如果有人正在寻找这个
添加一个webbrowser控件你的页面
并且这样做
GOt it..
If anyone else is looking for this
add a webbrowser control to your page
and do this
Dim array() As Byte = File.ReadAllBytes("C:\image.PNG")
Dim base64string As String = System.Convert.ToBase64String(array, 0, array.Length)
Dim str As String = "<div class=WordSection1>Image 1<br><img width=237 height=97 id=Picture_x0020_2 src=data:image/png;base64," + base64string + "></div>"
WebBrowser1.DocumentText = str
这篇关于渲染存储在DB中的图像作为html控件上的字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文