0
votes

Does anyone know of a way to load a bitmap image into a TWebBrowser component?

I've never attempted it before, not entirely sure where to begin if possible.

1
I removed the twebbrowser tag since that refers to the VCL component. Doesn't TWebBrowser render web pages? If you want to display a bitmap isn't that the wrong component? - David Heffernan
Navigate to file://path_to_bitmap - Sertac Akyuz

1 Answers

4
votes

Encode your bitmap with base64 (I think you can find online converters), then create a tag like this :

<img src="data:image/bmp;base64,BASE64DATAGOESHERE..." width="100" height="100" /> 

Embed this line into an Html tag and then use Webbrowser.LoadFromStrings

or use file:/// url