private Bitmap CreateScreenshot(Control Control, int x, int y)
{
Bitmap Screenshot = new Bitmap(1000, 1000);
Control.DrawToBitmap(Screenshot, new Rectangle(x, y, Control.Width, Control.Height));
return Screenshot;
}
private void resimAl()
{
IHTMLDocument2 doc = (IHTMLDocument2)Wb1.Document.Window.Frames.Item(0).Document.DomDocument;
mshtml.IHTMLSelectionObject sobj = doc.selection;
mshtml.HTMLBody body = doc.body as mshtml.HTMLBody;
sobj.empty();
mshtml.IHTMLControlRange range = body.createControlRange() as mshtml.IHTMLControlRange;
int a = Wb1.Document.Window.Frames.Item(0).Document.Images.Count;
mshtml.IHTMLControlElement img = (mshtml.IHTMLControlElement)Wb1.Document.Window.Frames.Item(0).Document.GetElementById("captcha_image").DomElement;
range.@add(img);
range.@select();
range.execCommand("Copy", false, null);
Bitmap bimg = new Bitmap(Clipboard.GetImage());
PictureBox1.Image = bimg;
}
zamanında yaptıgım bir projeden picturebox1 captcha imajı için, wb1 de webbrowser kodu incelersen anlarsın zaten