private BitmapSource GetScreenshot() { _window.BringToTop(); Thread.Sleep(100); return(_fs.TakeAScreenshot(_x, _y, _width, _height)); }
public void Process(object sender, CapturedScreenshotEventArgs image) { EventHandler <CapturedScreenshotEventArgs> action = (s, e) => { _window.BringToTop(); Thread.Sleep(100); var result = _fs.TakeAScreenshot(_x, _y, _width, _height); OnFiltered(new CapturedScreenshotEventArgs(result)); }; if (_effectBackground != null) { _effectBackground.Filtered += action; _effectBackground.Process(this, image); } else { action(this, image); } }