How to get image from Webbrowser page

  • Thread starter Thread starter Paul S
  • Start date Start date
P

Paul S

Hi

How can I programmatically save an image from a page locally?

The same as right-click the image and select 'Save as'

Tanks Paul S
 
Hi

How can I programmatically save an image from a page locally?

The same as right-click the image and select 'Save as'

Tanks Paul S

do you mean something like this: ?

System.Net.HttpWebRequest httpRequest = (HttpWebRequest)
System.Net.WebRequest.Create(imageURL);
System.Net.HttpWebResponse httpResponse =
(HttpWebResponse) httpRequest.GetResponse();
System.IO.Stream httpResponseStream =
httpResponse.GetResponseStream();

System.Drawing.Image imageIn =
System.Drawing.Image.FromStream(httpResponseStream);

httpResponseStream.Close();
httpResponse.Close();


more at http://www.siccolo.com/articles.asp
 
Hi Siccolo

I think this is close, but it looks as if you see the url to only contain
the image. The image is contained in a page. I know both name of the image
and the structure of the page. It does not change - only the image - it's a
weather report and for scurity reason this is the only way I can get the
image.

Thanks for the effort
Paul S
 
Sorry Mark
What would the proper forum be then ?

Paul S
Mark Rae said:
"Patrice" <http://www.chez.com/scribe/> wrote in message

[top-posting corrected]
"Paul S" <[email protected]> a écrit dans le message de
groupe de discussion :
(e-mail address removed)...

Not familiar with the web browser control but yes, you shouldn't have
those limitations that applies to a stand alone browser as you are working
from your own application.

If that's the case, then I misinterpreted the OP and believed that he was
referring to a browser-based app since he posted in the ASP.NET newsgroup...
 
Back
Top