Code: Select all | Expand
<div class="quick-item" onclick="callHarbourFunction('Clienti')">
<img src="img/clienti.png" alt="Clienti">
<div>Clienti</div>
</div>
I tried to insert the path of the images with local
Code: Select all | Expand
cFolder := cFilePath( GetModuleFileName( GetInstance() ) ) + "img/"
then I tried on the browser file:///C:/Work/errori/webview/img/clienti.png
the image opens from the browser but doesn't appear in TWebView, then the problem is due to TWebView that blocks the loading of local resources
chatgpt suggests me to set this parameter oWebView:lAllowLocalContent := .T. but it gives me an error telling me that it can't find this variable
TWebView2 doesn't know where to look for images
When you load an HTML file from disk, the browser knows that the path img/clienti.png means "img folder next to the HTML file".
If you instead generate the HTML in memory, TWebView doesn't have a reference path, so it doesn't find local images.
WebView2 may treat the HTML as a temporary file
Any solution ?