Thanks a lot for the code nop! I also have found a way to do it. Your way is much quicker though.
This is what I did, in case someone is looking for the same answers :
{
Bitmap bitmap = new Bitmap(webBrowser1.Width, webBrowser1.Height);
webBrowser1.DrawToBitmap(bitmap, new Rectangle(new Point(),
webBrowser1.Size));
pictureBox1.BackgroundImage = CropBitmap(bitmap, 1, 240, 200, 50);
}
The code for CropBitmap function :
public Bitmap CropBitmap(Bitmap bitmap, int cropX, int cropY, int cropWidth, int cropHeight)
{
Rectangle rect = new Rectangle(cropX, cropY, cropWidth, cropHeight);
Bitmap cropped = bitmap.Clone(rect, bitmap.PixelFormat);
return cropped;
}
What this does is it goes to the webbrowser , creates a bitmap image of the control , it crops the image and then displays it in the picturebox.