OpenNetCF HTMLViewer - images

  • Thread starter Thread starter Hilton
  • Start date Start date
Save your HTML into the file (e.g. test.html):

<html>
<body>
<img src="test.gif" />
</body>
</html>

.... and copy test.html, test.gif in the same directory with the application.

after that use:

string appDir =
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
htmlViewer.Url = "file://" + appDir + @"\test.html";

Sergey
 
Sergey,

Thank you for your reply.

Assuming the HTML is internal (i.e. string url = "<html>...</html>", can I
use images embedded in the EXE? i.e. I'd prefer not to have lots of images
in the directory.

I guess I could write the embedded images to the directory, set the URL, the
delete the images once the HTMViewer has accessed them (if there's a way to
know when). This will be slow(er), but it is a solution.

Hilton
 
You can't embed image in the EXE (also I was trying use "res://" but
have no success). To known when the document is loaded completely, catch
the event "DocumentComplete" and after that delete your temporary images.
 
Back
Top