How to specify src for img in wxHtmlWindow?

I've got a page that I display in a wxHtmlWindow that I generate
and load with SetPage(). Hence, it the wxHtmlWindow doesn't know
any file name or url for this page. This is OK, but the page
is supposed to display an image. All of the examples in the demo
show something like <IMG SRC="pic.png">, where the image is in the
same directory as the one the page was loaded from. I don't have
a directory like that, because my page is loaded from SetPage().
What format should I put the SRC filename in?

I've tried file names, e.g.:

  <IMG SRC="D:\Dir\dir2\pic.png">

I've tried file names with file:, e.g.:

  <IMG SRC="file:D:\Dir\dir2\pic.png">

I've tried URI(?), e.g.:

  <IMG SRC="///D|/Dir/dir2/pic.png">

I've tried file+ URI(?), e.g.:

  <IMG SRC="file:///D|/Dir/dir2/pic.png">

Nothing seems to work. Is this possible at all??? If so,
what's the secret handshake?

TIA,

(Python 2.2, WinNT 4.0 SP6, wxPython version 2.4.1.2)

Al

Hi,

achrist@easystreet.com wrote:

Nothing seems to work. Is this possible at all??? If so,
what's the secret handshake?

wxHtml can't yet parse all valid file:// URIs (but none of the above is, anyway), it can only handle one special form. Use wxFileSystem::FileNameToURL().

Ah, it seems its commented out in Python binding, at least in 2.5 tree. If it is not in wxPython 2.4.1 either, then have a look at filesys.cpp from wxWindows and implement same thing. Basically the URI is absolute filename (in native format), with "file:" or "file://" prefix and all occurences of "\" replaced with "/", "%" with "%25" and ":" with "%3A" (in this order!).

HTH,
VS