How can i save an image every second of a WebBrowser page url content ?
<p>Im using this code:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Drawing.Imaging;
namespace DownloadFlashFiles
{
    public partial class Form1 : Form
    {
        int i = 0;
        public Form1()
        {
            InitializeComponent();
            GenerateScreenshot("http://www.nana10.co.il");


        }

        private void Form1_Load(object sender, EventArgs e)
        {
        }
        public Bitmap GenerateScreenshot(string url)
        {
            // This method gets a screenshot of the webpage
            // rendered at its full size (height and width)
            return GenerateScreenshot(url, -1, -1);
        }
        public Bitmap GenerateScreenshot(string url, int width, int height)
        {
            // Load the webpage into a WebBrowser control
            //WebBrowser wb = new WebBrowser();
            webBrowser1.ScrollBarsEnabled = false;
            webBrowser1.ScriptErrorsSuppressed = true;
            webBrowser1.Navigate(url);
            while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); }
            // Set the size of the WebBrowser control
            webBrowser1.Width = width;
            webBrowser1.Height = height;
            if (width == -1)
            {
                // Take Screenshot of the web pages full width
                webBrowser1.Width = webBrowser1.Document.Body.ScrollRectangle.Width;
            }
            if (height == -1)
            {
                // Take Screenshot of the web pages full height
                webBrowser1.Height = webBrowser1.Document.Body.ScrollRectangle.Height;
            }
            // Get a Bitmap representation of the webpage as it's rendered in the WebBrowser control
            Bitmap bitmap = new Bitmap(webBrowser1.Width, webBrowser1.Height);
            webBrowser1.DrawToBitmap(bitmap, new Rectangle(0, 0, webBrowser1.Width, webBrowser1.Height));
            //webBrowser1.Dispose();
            return bitmap;
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            i++;
            Bitmap thumbnail = GenerateScreenshot("http://www.nana10.co.il");
            thumbnail.Save(@"d:\test4\" + i.ToString("D6") + "bmp", ImageFormat.Bmp);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Start();
        }

    }
}
</code></pre>

<p>The problem is when im clicking the button i see the content in the WerBrowser loading every second but it's never get to the code inside the timer1 tick event since it's stuck in the While loop in this line:</p>

<p><code>while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); }</code></p>

<p>What i want is to load a new content ot the webbrowser every second and also save the new content from the webbrowser every second to the hard disk.</p>

<p>How an i do it since it's stucking in the While loop ?</p>
