Image not getting loaded from My.Resources

K

K

i got code below which works fine but i cant see image which is in
My.Resources in webbrowser. Please can any friend help

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim imge
imge = My.Resources.Smile
Me.WebBrowser1.Navigate("about:<html><marquee scrolldelay=130>
Hello World<body leftmargin='0' rightmargin='0' topmargin='5'
bottommargin='0'><img src ='imge' height=20 width=20></img></body></
marquee></html>")
End Sub
 
F

Family Tree Mike

i got code below which works fine but i cant see image which is in
My.Resources in webbrowser. Please can any friend help

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim imge
imge = My.Resources.Smile
Me.WebBrowser1.Navigate("about:<html><marquee scrolldelay=130>
Hello World<body leftmargin='0' rightmargin='0' topmargin='5'
bottommargin='0'><img src ='imge' height=20 width=20></img></body></
marquee></html>")
End Sub

There is probably a way to include an imbedded image into your html.
That is what you would need to do, as the img tag tells the browser to
fetch the image from a file, defaulting to the same server as the html.
Your application has no way of accepting requests from this html to
send the image to the browser.
 
H

Herfried K. Wagner [MVP]

Am 19.03.2010 22:02, schrieb Family Tree Mike:
There is probably a way to include an imbedded image into your html.

'data' URIs (however, these are not supported by all versions of IE).
That is what you would need to do, as the img tag tells the browser to
fetch the image from a file, defaulting to the same server as the html.
Your application has no way of accepting requests from this html to send
the image to the browser.

You could also embed the images as Win32 resources and reference them
using the 'res' URI scheme.

The 'SelectWin32Resource' macro might be useful when taking this
approach. Win32 resources can be created using Visual Studio, for example.

<URL:http://dotnet.mvps.org/dotnet/code/application/#Win32Resource>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top