.NET Framework - Local Image on a WebBrowser control

Asked By Zeno Loco
04-Dec-07 02:53 AM
Hi,

I need to create an HTML page on a WebBrowser and insert there an
image stored in the device.
In the OnLoad event I use the following code :

Dim img As String = "\My Documents\WiSoul\Image1.jpg"
WebBrowser1.DocumentText = "" + _

but the image is not found.
Any idea?

Thank's
Marcello
WebBrowser1.DocumentText
(1)
WebBrowser
(1)
Application
(1)
OnLoad
(1)
Visual
(1)
Image
(1)
Local
(1)
WiSoul
(1)
  Peter Morris replied...
03-Dec-07 08:45 AM
Doesn't that need to be

file://My Documents/WiSoul/Image.jpg

?


Pete
  NinoBenvenut replied...
03-Dec-07 09:07 AM
Yes, the path needs prefaced with file:
  Zeno Loco replied...
07-Dec-07 01:50 AM
Thank's Nino ana Pete but the following modified code doesn't show the
image (only the aaa string and the image placeholder)

Dim img As String = "file://Programmi/wisoul/test.jpg"
Dim HTML As String = "<CENTER>aaa</CENTER><BR>" + _
WebBrowser1.DocumentText = HTML


Marcello



On 3 Dic, 14:07, Nino Benvenuti
  srharton replied...
04-Dec-07 02:40 PM
You need to include only one forward slash in the "file:/" definition, change
your code to the following then it should work:

Dim img As String = "file:/Programmi/wisoul/test.jpg"
Dim HTML As String = "<CENTER>aaa</CENTER><BR>" + _
WebBrowser1.DocumentText = HTML

--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com
  Zeno Loco replied...
07-Dec-07 01:50 AM
Now it works, thank's!
Marcello
Create New Account
help
the Manifest Tool executable? error PRJ0002 : Error result -1073741819 returned from 'C: \ Program Files \ Microsoft Visual Studio 8 \ VC \ bin \ mt.exe'. The above error occurs when I attempt to build I have found suggest that it is an error that relates to BETA versions of Visual Studio but I have never had any Betas installed. I do, however, have a full copy of Visual Studio 6 installed on my development machine as well as VS2005. Settings that apply to as to how to rectify this problem with the Manifest Tool executable? Thanks, Robert Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) Microsoft .NET Framework Version 2.0.50727 Installed Edition: Professional Microsoft Visual Basic 2005 77626-009-0000007-41504 Microsoft Visual Basic 2005 Microsoft Visual C# 2005 77626-009-0000007-41504 Microsoft Visual C# 2005 Microsoft Visual C++ 2005 77626-009-0000007-41504 Microsoft Visual C++ 2005 Microsoft
NET Framework Relationship between Application.Exit() and AppDomain Hi, Does Application.Exit() apply only to the AppDomain in which it is called? Is it the same as in WPF – a single Application object per AppDomain? Generally speaking, what is the relationship between an Application object and AppDomain objects? Regards, Sunny S. One AppDomain per application. One or more AppDomains in a Process. WPF doesn't change this as WPF is still a .NET application and is still run by the CLR. Application.Exit will kill the application you are calling it on and therefore the AppDomain it is running in. As far
if anyone could give me some advice. I am looking to develop an ASP.NET application that will enable several = workstations to access real time telemetry data received from a vehicle Server- | - - Workstation 3 | - - Workstation 4 | - - Workstation n The workstations would be running the same web application which would = enable them to set up one or more "views", with graphs, gauges, and = other visual components, as well as controls that would enable them to = change setting on the vehicle because they use images to update). I want to keep this as an ASP.NET application, so theoretically anyone = could access the data in real time over the internet, whether they 20 give me some advice.<BR> <BR> I am looking to develop an ASP.NET = application that = 20 will enable several workstations to access real time telemetry data = received = 20 from nbs = p; ; = = 20 size = 3D2> &nbs = p; ; = | - - = 20 Workstation n< / FONT> < / DIV> same web = 20 application which would enable them to set up one or = more "views", = 20 with graphs, gauges, and other visual components, as well as controls = that would = 20 enable them to change setting on the rate = 20 is very slow (I think because they use images to update).< / FONT> < / DIV> application, so = 20 theoretically anyone could access the data in real time over the = internet, = 20
that is not what I need. I have tried re-installing Service Pack 1 for Visual Studio 2008. I am really hoping that I will not have to to a un-install of Visual Studio. I am running Windows XP Version 5.1.2600 Service Pack 3 Build 2600 Just in-case it is helpful, I am pasting the info from my Visual Studio about window below * ** ** **ABOUT INFO* ** ** * Microsoft Visual Studio 2008 Version 9.0.30729.1 SP Microsoft .NET Framework Version 3.5 SP1 2008 91901-270-0733375-60035 Microsoft Silverlight Projects 2008 Version 9.0.30729.146 Microsoft Visual Basic 2008 91901-270-0733375-60035 Microsoft Visual Basic 2008 Microsoft Visual C# 2008 91901-270-0733375-60035 Microsoft Visual C# 2008 Microsoft Visual C++ 2008 91901-270-0733375-60035 Microsoft Visual C++ 2008 Microsoft