HtmlElement flash = tab.FindElementByAttribute("embed", "id", "movie_player", "text", 0);
Image img = Image.FromFile("D:\\Zen\\Projects\\flash\\Image5.bmp");
Rectangle flash_rectangle = new Rectangle(flash.DisplacementInDocument.X, flash.DisplacementInTabWindow.Y, flash.Width, flash.Height);
Rectangle search_rectangle = new Rectangle(flash_rectangle.X,flash_rectangle.Y,60,50);
Rectangle found_rectangle = new Rectangle(0,0,0,0);
using (var ms = new System.IO.MemoryStream())
{
img.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
byte[] imageBytes = ms.ToArray();
base64String = Convert.ToBase64String(imageBytes);
}
do
{
rectangleString = tab.FindImage(base64String, new[] {search_rectangle}, 99);
if (!String.IsNullOrWhiteSpace(rectangleString))
{
string[]split = rectangleString.Split(',');
found_rectangle = new System.Drawing.Rectangle(System.Convert.ToInt32(split[0].Trim()), System.Convert.ToInt32(split[1].Trim()), System.Convert.ToInt32(split[2].Trim()), System.Convert.ToInt32(split[3].Trim()));
if (!found_rectangle.IsEmpty)
{
Emulator.MouseСlick(instance.ActiveTab.Handle, MouseButton.Left, MouseButtonEvent.Click, found_rectangle.X, found_rectangle.Y);
//здесть можно кликнуть
}
}
}
while(flash_rectangle.Width > (search_rectangle.X += search_rectangle.Width/2));