Webbrowser

  • Thread starter Thread starter Able
  • Start date Start date
A

Able

Dear friends

Im loading an image to the browser like this:

<IMG src=" & "C:\Default.gif" & ">"

The code expects the filename and adress as a string. But is it possible to
load the image from an ImageList? This causes error:

<IMG src=" & ImageList1.Images.Item(0) & ">"

Regards Able
 
First of all, & is a string concatination operator. It only works with
strings. In your code, you are trying to concatinate a String with an Image
object. That will always cause an error.
But secondly, the IMG tab tells the browser to go back to the server after
the page is done and fetch another file (an image file). This approach won't
work.

However, there are ways of putting a "fake" filename into the IMG src
attribute, and when the browser makes a request for that file, you can serve
an image from memory (if you are making an ASPX application). There are
several samples of doing this on the web.

-Rob Teixeira [MVP]
 
* "Able said:
Im loading an image to the browser like this:

<IMG src=" & "C:\Default.gif" & ">"

The code expects the filename and adress as a string. But is it possible to
load the image from an ImageList? This causes error:

<IMG src=" & ImageList1.Images.Item(0) & ">"

No, that's not supported. Evene "C:\Default.gif" may not work,
"file:///c:/Default.gif" or something similar is the preferred way. You
will have to store your file temporarily, for example, by calling its
'Save' method and specifying the GIF file format.
 
Hi Able,

When we are talking here about Webbrowser that is mosty a progragram that
does the same things as Internet Explorere, are you maybe talking about a
webpage?

When that is so, than you can only use URL's as the IMG src, that can be a
proper URL or an image on disk.

However that image on disk will mostly work alone on your workstation when
you use your own disk. For a client that does only work when he has that
image on the same place on his disk.

Whatever method you use for the src, it has to be forever an URL and never
an image from memory.

I hope this helps?

Cor
 
Back
Top