Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > ASP.NET

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-01-2009, 11:33 PM
HoangTuDauMat HoangTuDauMat is offline
Registered User
 
Join Date: Nov 2009
Posts: 1
Getting an Image from webBrowser

Hello !
I would like to programmatically download and save the image
webBrowser2.Url = new Uri("http://www.somewhere.com/images/captcha.png");
do
{
System.Threading.Thread.Sleep(100);
} while (webBrowser2.IsBusy || !webBrowser2.DocumentStream.CanRead);

Bitmap i = new Bitmap(webBrowser2.DocumentStream);
i.Save("myimage.jpg");
what wrong with my code ? it dont work , hix .
I want to use webBrowser to download image in this session because this image is randomly generated in every request, for example, if i open the page it show an image, if i refresh the page the image changes.

I think the Stream from webBrowser is incorrect .
webBrowser2.Url = new Uri("http://www.somewhere.com/images/captcha.png");
webBrowser2.DocumentStream <= this is not image stream .
Have you another way to get correct image stream from webBrowser2 ?

Thanks in advance
Reply With Quote
  #2  
Old 11-02-2009, 08:56 AM
Hack's Avatar
Hack Hack is offline
Super Moderator
 
Join Date: Apr 2007
Location: Sterling Heights, Michigan
Posts: 7,719
Try using the webclient/webRequest for Downlaoding file from remote server


http://www.csharpfriends.com/Article...?articleID=115
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista

Microsoft MVP 2005/2006/2007/2008/2009
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get image url inside javascript from webbrowser control freaky .NET 0 04-19-2008 05:50 AM
help regarding image processing laxmi Java 6 02-03-2006 01:55 PM
Save image file from WebBrowser control mechis VB Classic 4 01-26-2006 07:29 PM
How do I Automatically Resize a control Button Image? James Graham .NET 3 03-18-2002 11:05 AM
Script for scrolling Mark Web 3 08-30-2001 12:45 PM


All times are GMT -4. The time now is 11:04 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.