My apologies to resurrect a new thread the previous thread (since I was unable to edit the previous thread)
Is there a way to add an image in webview using html?
I am trying the following but no luck
self.Info=wx.html2.WebView.New(self)
self.Info.SetPage(
“”"<!doctype html>

Hello
“”"
)
Also Is it possible to use css in webview to select a customized font from a font file on a local machine? I have been attempting to do this but no luck
Thanks…
Web view can, of course, display images - however your html needs to be
valid - e.g. <img src='/root/bizpic4.jpg'> needs to be a valid url and
should really be a terminated tag so:
<img src='file:/root/bizpic4.jpg' />
is a lot more likely to work.
···
On 17/10/2015 03:13, jay dee wrote:
My apologies to resurrect a new thread the previous thread (since I was
unable to edit the previous thread)
Is there a way to add an image in webview using html?
I am trying the following but no luck
self.Info=wx.html2.WebView.New(self)
self.Info.SetPage(
"""<!doctype html>
<html>
<body>
<img src='/root/bizpic4.jpg'>
<button id="send">Hello</button>
</body>
</html>"""
)
Also Is it possible to use css in webview to select a customized font
from a font file on a local machine? I have been attempting to do this
but no luck
Thanks..
--
You received this message because you are subscribed to the Google
Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to wxpython-users+unsubscribe@googlegroups.com
<mailto:wxpython-users+unsubscribe@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.
Thanks Steve (Gadget) Barnes)
I tried using placing my html codes in a file and using the “.LoadPage” method in webview and the image displayed nicely…
However This was not my choice of using html because creating several html files and loading it into webview can be a security loophole
SOLUTION (not elegant but I can work with it until i figured out a nicer way)
I found this link http://wxpython.org/Phoenix/docs/html/html2.WebView.html which mentioned “data://” and look up wikipedia data URI scheme - Wikipedia, on how to use it…
I converted my image to base64 string and save the information directly in my gui program. Afterwards I was able to load the image as follows:
==)
I hope the .SetPage method for Webview can allow for loading image and font files using the “src” attribute in html in the future (I haven’t quite figure out what happened here).
···
On Saturday, October 17, 2015 at 2:52:00 AM UTC-4, Gadget Steve wrote:
On 17/10/2015 03:13, jay dee wrote:
My apologies to resurrect a new thread the previous thread (since I was
unable to edit the previous thread)
Is there a way to add an image in webview using html?
I am trying the following but no luck
self.Info=wx.html2.WebView.New(self)
self.Info.SetPage(
"""<!doctype html>
<html>
<body>
<img src='/root/bizpic4.jpg'>
<button id="send">Hello</button>
</body>
</html>"""
)
Also Is it possible to use css in webview to select a customized font
from a font file on a local machine? I have been attempting to do this
but no luck
Thanks…
–
You received this message because you are subscribed to the Google
Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to wxpython-user...@googlegroups.com
mailto:wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Web view can, of course, display images - however your html needs to be
valid - e.g.
needs to be a valid url and
should really be a terminated tag so:
![]()
is a lot more likely to work.
–
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.