Image not getting loaded from My.Resources

  • Thread starter Thread starter K
  • Start date Start date
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
 
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.
 
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>
 
Back
Top