Hi dear Gintaras,
I am sorry to bother you again, I was stumped by another UI element screenshot issue. I am extracting all the logos from a website Brand, Below is my code:
I just set the row number per page to "All" to get rid of using too many for loops, that way I could use e.ScrollTo() instead of click turn page button. The problem is the screenshots which was taken are missing edge sometimes. I would like to ask your advise to get rid of this problem. Thank you so much!
I have sort of solved this problem by insert var e2 and e2.ScrollTo(); .2.s(); ,I would like to know if there is any efficient solution?
I am sorry to bother you again, I was stumped by another UI element screenshot issue. I am extracting all the logos from a website Brand, Below is my code:
var w = wnd.find(1, "Global 500 2023 | Brand Value Ranking League Table | Brandirectory - Google Chrome", "Chrome_WidgetWin_1");
for (int i = 2; i < 20; i++) {
var e = w.Elm["web:DOCUMENT", "Global 500 2023 | Brand Value Ranking League Table | Brandirectory", navig: $"fi3 ch5 fi3 ch{i} ch3"].Find(1);
e.ScrollTo();
using var bitmap = CaptureScreen.Image(e.Rect);
var ms = new MemoryStream();
bitmap.Save(folders.Desktop + $"logo/{e.Name.Split("/")[0]}.png");
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
print.it($"<><image \"image:{Convert.ToBase64String(ms.ToArray())}\">");
ScriptEditor.ShowMainWindow(true);
}
I just set the row number per page to "All" to get rid of using too many for loops, that way I could use e.ScrollTo() instead of click turn page button. The problem is the screenshots which was taken are missing edge sometimes. I would like to ask your advise to get rid of this problem. Thank you so much!
I have sort of solved this problem by insert var e2 and e2.ScrollTo(); .2.s(); ,I would like to know if there is any efficient solution?
var w = wnd.find(1, "Global 500 2023 | Brand Value Ranking League Table | Brandirectory - Google Chrome", "Chrome_WidgetWin_1");
for (int i = 2; i < 50; i++) {
var e = w.Elm["web:DOCUMENT", "Global 500 2023 | Brand Value Ranking League Table | Brandirectory", navig: $"fi3 ch5 fi3 ch{i} ch3"].Find(1);
var e2 = w.Elm["web:DOCUMENT", "Global 500 2023 | Brand Value Ranking League Table | Brandirectory", navig: $"fi3 ch5 fi3 ch{i+5} ch3"].Find(1);
e2.ScrollTo(); .2.s();
using var bitmap = CaptureScreen.Image(e.Rect);
var ms = new MemoryStream();
bitmap.Save(folders.Desktop + $"logo/{e.Name.Split("/")[0]}.png");
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
print.it($"<><image \"image:{Convert.ToBase64String(ms.ToArray())}\">");
ScriptEditor.ShowMainWindow(true);
}