HtmlElement he = instance.ActiveTab.FindElementByAttribute("body","fulltag","body","text",0);
int heHeight = Convert.ToInt32(he.GetAttribute("height"));
int heWidth = Convert.ToInt32(he.GetAttribute("width"));
int step =2000;
int countOfIterations = heHeight/step;
var bitmaps = new List<System.Drawing.Bitmap>();
int count =0;
for(int i =0;i<countOfIterations;i++)
{
var text = he.DrawPartToBitmap(0, i*step, heWidth, step, true);
byte[] imageBytes = Convert.FromBase64String(text);
var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
img.Save(@"{-Project.Directory-}"+@"Images\"+project.Variables["Name"].Value+i.ToString()+@".jpg");
count++;
}
int lastPieceHeight = heHeight%step;
if (lastPieceHeight>10)
{
var text = he.DrawPartToBitmap(0, heHeight-lastPieceHeight, heWidth, lastPieceHeight, true);
byte[] imageBytes = Convert.FromBase64String(text);
var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
img.Save(@"{-Project.Directory-}"+@"Images\"+project.Variables["Name"].Value+@".jpg");
}
You can also use captchaSaver.dll and mark body tag as captchaI know how to capture a captcha with captchasaver but not the entire page.
Thank you very much but I preferred solution rostonix because I'm not a programmerКод:HtmlElement he = instance.ActiveTab.FindElementByAttribute("body","fulltag","body","text",0); int heHeight = Convert.ToInt32(he.GetAttribute("height")); int heWidth = Convert.ToInt32(he.GetAttribute("width")); int step =2000; int countOfIterations = heHeight/step; var bitmaps = new List<System.Drawing.Bitmap>(); int count =0; for(int i =0;i<countOfIterations;i++) { var text = he.DrawPartToBitmap(0, i*step, heWidth, step, true); byte[] imageBytes = Convert.FromBase64String(text); var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length); var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms); img.Save(@"{-Project.Directory-}"+@"Images\"+project.Variables["Name"].Value+i.ToString()+@".jpg"); count++; } int lastPieceHeight = heHeight%step; if (lastPieceHeight>10) { var text = he.DrawPartToBitmap(0, heHeight-lastPieceHeight, heWidth, lastPieceHeight, true); byte[] imageBytes = Convert.FromBase64String(text); var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length); var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms); img.Save(@"{-Project.Directory-}"+@"Images\"+project.Variables["Name"].Value+@".jpg"); }
HtmlElement he = instance.ActiveTab.FindElementByAttribute("body","fulltag","body","text",0);
int heHeight = Convert.ToInt32(he.GetAttribute("height"));
int heWidth = Convert.ToInt32(he.GetAttribute("width"));
var bitmaps = new List<System.Drawing.Bitmap>();
var text = he.DrawPartToBitmap(0, 0, heWidth, 3000, true);
byte[] imageBytes = Convert.FromBase64String(text);
var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
img.Save(@"{-Project.Directory-}"+@"images2\"+project.Variables["Name"].Value+@".jpg");