It's not really a programming question, but I can't get to a solution about it. I have a HTML page, directly on the device. (Documents/Help.html). In the Documents folder I have also images (Image.png). What I want is to display the HTML in a webbrowser component with images. I can load the HTML with no problem with this:
But these aren't working, I just see an empty square instead of my image. :( I see in other forums it should work, but they used an XCode based App (I don't think it's the problem, the Webbrowser should be the same native one).
Thanks, greetings
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
It's not really a programming question, but I can't get to a solution about it. I have a HTML page, directly on the device. (Documents/Help.html). In the Documents folder I have also images (Image.png). What I want is to display the HTML in a webbrowser component with images. I can load the HTML with no problem with this:
But I can't manage to display the images in it. I've tried the followings:
But these aren't working, I just see an empty square instead of my image. :( I see in other forums it should work, but they used an XCode based App (I don't think it's the problem, the Webbrowser should be the same native one).
Thanks, greetings
You are rigth. There's a problem with relative path.
This works;
DPFWeb1.LoadFromFile(GetAppFolder+ 'image1.jpg','image/jpeg','');
And also This works:
In the img tag add the real image path (in my case GetAppFolder)
src="file:///'+ GetAppFolder +'/image1.jpg"
save into a html file and load it
DPFWeb1.LoadFromFile(htmlfile,'text/html','utf-8')
Last edit: luca 2013-10-25
So I have to rewrite the whole HTML file on-the-fly to get the images loaded... fantastic :D I'll try it, thanks for the tip!
I think you can load a template , build a html string and use LoadFromString
Last edit: luca 2013-10-25
Thanks, the LoadFromString works perfectly!
Hi Luca and Fenistil
Do you have any sample for this topic, please share with us. Thanks
Hi!
I use the followings, and works great:
The HTML file:
And the Delphi code:
Good luck!
Greetings
Hi
I need your support
I opened a html file with webbrowser component (UIWebView)
the html file like
...
Click-1
Click-1
...
I need click event info/clicked link.
How can get info when clicked link in html file like "link1.html" clicked.
Thanks
Last edit: Ahb Toplama 2014-04-15