1

I have been attempting to capture a webpage for automation purposes however I have been having issues where DrawToBitmap() returns a white picture. It seems to me that it returns white when the DOM has been changed or the browser navigates.

For example I am filling out the login form programatically and then submitting the form, and it seems that once I give the AJAX request enough time to complete and the browser gets redirected it will ALWAYS produce a white image.

I fixed that problem by disposing of and recreating my WebBrowser instance and then navigating directly to the post-login page. This works fine if I take the screen shot when the ReadyState is 'Complete'. However if I give it enough time to load the data for the graphs in and other data it needs then I get a white image.

I have also tested and can confirm that it is not the delay in the program that is causing the white image.

Any help would be greatly appreciated!

Thanks!

FraserK
  • 304
  • 1
  • 3
  • 17
  • Sometimes `DrawToBitmap` doesn't work. Try [this](http://stackoverflow.com/questions/2434156/webbrowser-drawtobitmap-or-other-methods/2434231#2434231) or [this](http://stackoverflow.com/questions/11959170/webbrowser-drawtobitmap-leaves-white-pixels). – Iagows Sep 20 '13 at 20:37
  • A related q/a: [How to fix a opacity bug with DrawToBitmap on WebBrowser Control?](http://stackoverflow.com/q/21697048/1768303) – noseratio Feb 18 '14 at 08:10

0 Answers0