public bool CloseImgPopup()
{
try
{
var isClose = false;
var imgs = DicImgClose();
foreach (var img in imgs)
{
var rectangle = instance.DroidInstance.Screen.FindImageGrayscale(img.Key, img.Value, 90);
if (rectangle.IsEmpty)
continue;
var xMax = rectangle.X + rectangle.Width;
var yMax = rectangle.Y + rectangle.Height;
instance.DroidInstance.Input.Touch(rectangle.X, rectangle.Y, xMax, yMax, longPress: false, "Random");
isClose = true;
}
return isClose;
}
catch (Exception ex)
{
throw new Exception("CloseImgPopup:" + ex.Message);
}
}
private Dictionary<string, Rectangle[]> DicImgClose()
{
var imgs = new Dictionary<string, Rectangle[]>();
imgs.Add(
"iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAANkSURBVGhD7ZgLctowEIZ7yIZXexngMg2Q9jAMHKaBuPpU/5plK2QrGJpprZl/JNl67OfdtQyfzudz8y/o/wGh+PbpdErtj6KbPAJQ7vrf0E0gH8krVaG13++b5XLZzOfzZrfbXYy7RYfDoVmv181isYjt3JguVXkEgNlslrTdblN4pTAL6VNS8/Zbau+235vZdJHEg3pPDlaBrFarZjqdRiBBCUbyhnth/On1Lba3m5do/Hz2JYGwbm7vLlWBEFqCEAi19Yw3/Jpedj8uACRCVh6heBuuqQqEDTAa4/EMIPJQgnEGe+ERPAHEdBIehoHgOvtQBONtuKZqELTZbFKe/AHTho1qGa+2wklazL8miDjH7HdXEC2O0YIQUIRpDZKUE8hDyCPREy2o3U979VE1iO3jGYy/8EwImfR0W+No53JCYzXmoSBanKIwu8iZ8JQ9DG2bExqzeQ5nEca3iiFo9qPYfkn1HrGbhtqGDAZOQv0U6mkw9Dlc/xaM5VrSZJLyya/vDff9km4G8TBAyGhgLAT3gNAr1q/vDff9kgbxiASMNd5CIe6l17TWM+t7w32/pME8oppwwmALoVAjzOxa3tCufkmDgNg2INYLFoh7uXUlb7jvl3QziA0xQgu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