Re: axWebBrowser not displaying images



The axWebBrowser will not render either the bmp or the jpg files. IE 7 will
render the jpg file but not the bmp files. I've even tried converting the
bitmaps to GIF files and it's the same - IE7 OK, axWebBrowser - Not OK.

Here's more...the HTML being sent to the axWebBrowser is a simple table
(below). Our first take on this was to generate an HTML file saved to disk
and launch IE. This will now work for us as we've learned that if we change
our file type to jpg or gif IE is cool with that. When we tried to embed
this report into the app we found that none of the file types display. When
we run the app and right click on the browser control and do a view source,
what displays in notepad is <HTML></HTML>...I don't get that...

Here's the code that loads the browser control (axWeb06):

try

{

StringBuilder sbHtml = new StringBuilder();
axWeb06.Navigate("about:blank", ref _empty, ref _empty, ref _empty, ref
_empty);

_doc = axWeb06.Document as IHTMLDocument2;

//wait for document to load

while (_doc.body == null) Application.DoEvents();

strHitChart = "<table border=1><tr><td colspan=2 align=center><B>HIT CHART "
+ lbHitTeam.Text + " " + lbHitYear.Text + " " + strDowns +
"Downs</td></tr><tr>";

sbHtml.Append (strHitChart);

// database queries follow to get the rest of the data and do subsequent
sbHtml.Append...

//write the HTML to the document's body

_doc.body.innerHTML = sbHtml.ToString();

}

catch(Exception ex)

{

MessageBox.Show("Error generating HIT Chart - " + ex.Message);

}

This is the html result:

<table border=1><tr><td colspan=2 align=center><B>HIT CHART OHIO 2005
1st&2nd Downs</td></tr><tr><td><table><tr><td><b><u>S UNO SL</u>: <font
color=Blue>TOL </font><font color=DeepPink>BSU </font><font
color=LimeGreen>BUFF </font></TD></TR><TR><TD width=400><b>BBPS:<font
color=DeepPink>1 </font><font color=LimeGreen>3 </font>BNCE NKO:<font
color=DeepPink>7 </font>BUB SCRN:<font color=Blue>1 </font></TD></TR><tr><td
align=center><b>9 - 12</b></td></tr> <tr><td><img
src='Formation3.gif'></img> </td></tr><TR><TD width=400><b>ZN:<font
color=Blue>2 </font><font color=DeepPink>1 </font>ZN WK:<font color=Blue>2
</font><font color=DeepPink>4
</font></TD></TR></table></td><td><table><tr><td><b><u>GO UNO</u>: <font
color=Blue>TOL </font><font color=DeepPink>BSU </font><font
color=LimeGreen>BUFF </font></TD></TR><TR><TD width=400><b>Z SWP NKD
WK:<font color=Blue>7 </font><font color=DeepPink>1 </font>Z SWP ROLL TRW
BK:<font color=LimeGreen>1 </font></TD></TR><tr><td align=center><b>3 -
9</b></td></tr> <tr><td><img src='Formation4.gif'></img> </td></tr><TR><TD
width=400><b>FK HND SWP QB CTR T:<font color=LimeGreen>1 </font>Z SWP:<font
color=LimeGreen>2
</font></TD></TR></table></td></tr><tr><td><table><tr><td><b><u>GO UNO
SL</u>: <font color=LimeGreen>BUFF </font></TD></TR><TR><TD
width=400><b>BNCE BT:<font color=LimeGreen>1 </font>STRCH BT:<font
color=LimeGreen>1 </font></TD></TR><tr><td align=center><b>0 -
2</b></td></tr> <tr><td><img src='Formation6.gif'></img> </td></tr><TR><TD
width=400><b></TD></TR></table></td><td><table><tr><td><b><u>GU UNO</u>:
<font color=DeepPink>BSU </font></TD></TR><TR><TD
width=400><b></TD></TR><tr><td align=center><b>6 - 0</b></td></tr>
<tr><td><img src='Formation7.gif'></img> </td></tr><TR><TD
width=400><b>ZN:<font color=DeepPink>5 </font>ZN WK:<font color=DeepPink>1
</font></TD></TR></table></td></tr><tr></tr></table>


"Registered User" <n4jvp@xxxxxxxxxxxxx> wrote in message
news:c33ch3hm3ofst73gcjqnvekipjedbloain@xxxxxxxxxx
On Tue, 16 Oct 2007 13:39:08 -0400, "Tom"
<tom.gaughan@xxxxxxxxxxxxxxxxx> wrote:

Any idea why IE won't render bitmaps?

Where using a basic img tag:
<img src='formationimages\\formation" + intFormationID + ".jpg'>


Would it work if the extension in the example were changed to ".bmp"?

regards
A.G.


.



Relevant Pages

  • Re: Windows app or ASP.NET ?
    ... or DreamWeaver to write all of your HTML for you. ... With proper usage of and .css and intellisense it is not so difficult. ... need graphics (.gif or .jpg files) to be of a particular size and for ... several such graphics to work well together to make the page look ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Generating an html File with Word Office 2003
    ... It appears saving the file as filtered (htm) does help, but not quite in my instance. ... I have a mixture of pictures and text. ... I'm slowly adding html to the file and checking to see if the problem disappears. ... The jpg files are Tight and positioned as Other. ...
    (microsoft.public.word.newusers)
  • Generating an html File with Word Office 2003
    ... I thought I'd see if I could generate an html file with a Word document. ... The jpg files are Tight and positioned as Other. ... Anyway, I proceeded to make it htm, and put it up on the server for my web page. ...
    (microsoft.public.word.newusers)
  • catch click button with axWebBrowser interop
    ... But I could not find how to catch a html form's button click with C#. ... There is a in the html page displayed by the axWebBrowser, ... In fact, I don't want to send the form over Internet, the html page is the interface of the application;o) ... cyrille. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: javascript and axwebbrowser
    ... > Can i launch a javascrit function on a HTML page which is on a ...
    (microsoft.public.dotnet.languages.csharp)