Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
        private void btnCaptureIage_Click(object sender, EventArgs e)
        {
         webBrowser1.Select();   
           Application.DoEvents();
            Bitmap bitmap = new Bitmap(webBrowser1.Width, webBrowser1.Height);
            webBrowser1.DrawToBitmap(bitmap, new Rectangle(0, 0, 
            webBrowser1.Width,webBrowser1.Height));                     
            pictureBox1.BackgroundImage = bitmap;
            Application.DoEvents();
}
Posted

1 solution

You are not alone in experiencing problems with using this method on the WebBrowser Control: it's a method meant for internal use that Microsoft tells you not to use: [^].

And, yes, this is a logical question to ask: why, if it is not meant to be used by "mere mortals," is it made available ?

Here's another approach: [^]; imho, this entire StackOverFlow thread is well worth studying.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900