Search code examples
delphifiremonkeydelphi-xe8

Load bitmap into TWebbrowser


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.


Solution

  • 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