private bool Ch4() { var res = false; var sw = new Stopwatch(); var r = Imports.NativeMethods.GetAbsoluteClientRect(BdoP.MainWindowHandle); var X = r.X; var Y = r.Y; var CAX = X + r.Width / 2; var CAY = Y + r.Height / 2; sw.Start(); while (!res && sw.ElapsedTicks < TimeSpan.FromMilliseconds(time).Ticks) { var b = new Sbmp(_sc); var Filtr = new System.Drawing.Rectangle(CAX - 409, CAY - 216, 38, 10); if (_mfiltr.Compare(b, Filtr)) { res = true; b.Dispose(); break; } b.Dispose(); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { })); } sw.Stop(); return(res); }
private bool Ch3() { var res = false; var sw = new Stopwatch(); sw.Start(); while (!res && sw.ElapsedTicks < TimeSpan.FromMilliseconds(time).Ticks) { var s = new Sbmp(_sc); if (s.GetPixel(0, 0).A != 0) { res = true; s.Dispose(); break; } s.Dispose(); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { })); } sw.Stop(); return(res); }