i want to show an image in HTMLViewer. this code works perfectly
<img src="http://3.bp.blogspot.com/-v00OseExWT4/TmzHWyUSOiI/AAAAAAAAKvc/Bw5q3sAY8R4/s1600/red-flower-icon.png">
how i could do the same but extracting the image from a DB?
must be taken into account that the HTMLViewer control only accepts as a parameter the entry of a string. for example:
[code] Dim f As FolderItem = GetTemporaryFolderItem
dim htmlstring as string
htmlstring="<img src="“http://3.bp.blogspot.com/-v00OseExWT4/TmzHWyUSOiI/AAAAAAAAKvc/Bw5q3sAY8R4/s1600/red-flower-icon.png”">"
HTMLViewer1.LoadPage(htmlstring, f)[/code]
Save the picture as file in the temporary folder with something like
[code]Dim f As FolderItem = GetTemporaryFolderItem
f.name = f.name + “.png”
//Create picture from data coming from the db
'decodehex, picturefromdata
// save
pic.Save(f, Picture.SaveAsJPEG)
[/code]
Then load it in the HTMLViewer with LoadURL
HTMLViewer1.LoadURL(f.URLPath)
When building apps with an HTML interface I often in-line images in the HTML. This circumvents the need to run a local web server. You can embed images in HTML. The crux of it is get the image data and then base64 encode it. You end up with an image tag that looks like:
![beastie.png]()
I got that example from: http://www.techerator.com/2011/12/how-to-embed-images-directly-into-your-html/
great ideas! i think the solution i need is the one proposed by @Phillip Zedalis … thanks a lot both of you