Take Screenshots of WebBrowser Control?

You could use Control.DrawToBitmap() even though it is hidden from Intellisense in VisualStudio. The WebBrowser still inherits from the base class Control, so this method does exist. But what I did was create a MenuStrip with a MenuItem that I used to test this (this is basically just a standard click-event), and instead created a graphics object, and copied a portion of the screen using the correct cordinates.

The only things you will need to adjust really, is the name of the WebBrowser control, and the line that actually saves the image.

You could use Control.DrawToBitmap(), even though it is hidden from Intellisense in VisualStudio. The WebBrowser still inherits from the base class Control, so this method does exist. But what I did was create a MenuStrip with a MenuItem that I used to test this (this is basically just a standard click-event), and instead created a graphics object, and copied a portion of the screen using the correct cordinates.

The only things you will need to adjust really, is the name of the WebBrowser control, and the line that actually saves the image. Private void copyToolStripMenuItem_Click(object sender, EventArgs e) { int width, height; width = webBrowser1.ClientRectangle. Width; height = webBrowser1.ClientRectangle.

Height; using (Bitmap image = new Bitmap(width, height)) { using (Graphics graphics = Graphics. FromImage(image)) { Point p, upperLeftSource, upperLeftDestination; p = new Point(0, 0); upperLeftSource = webBrowser1. PointToScreen(p); upperLeftDestination = new Point(0, 0); Size blockRegionSize = webBrowser1.ClientRectangle.

Size; graphics. CopyFromScreen(upperLeftSource, upperLeftDestination, blockRegionSize); } image. Save("C:\\Test.

Bmp"); } }.

This is exactly what I need...thanks – Sandeep Pathak Sep 10 '10 at 7:03.

Here's an article illustrating this. And there's another. And even more.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions