public void Process(object sender, CapturedScreenshotEventArgs image) { EventHandler<CapturedScreenshotEventArgs> actionWhite = (s, e) => { _white = GetScreenshot(); _effectBackgroundBlack.Process(this, image); }; EventHandler<CapturedScreenshotEventArgs> actionBlack = (s2, e2) => { _black = GetScreenshot(); OnBothFiltered(new CapturedScreenshotEventArgs(null)); }; _effectBackground.Filtered += actionWhite; _effectBackground.Process(this, image); _effectBackgroundBlack = new EffectBackground(_effectBackground.X, _effectBackground.Y, _effectBackground.Width, _effectBackground.Height); _effectBackgroundBlack.SetBackground(new SolidColorBrush(Colors.Black)); _effectBackgroundBlack.Filtered += actionBlack; this.BothFiltered += ProcessTransparency; }
public void Process(object sender, CapturedScreenshotEventArgs image) { EventHandler <CapturedScreenshotEventArgs> actionWhite = (s, e) => { _white = GetScreenshot(); _effectBackgroundBlack.Process(this, image); }; EventHandler <CapturedScreenshotEventArgs> actionBlack = (s2, e2) => { _black = GetScreenshot(); OnBothFiltered(new CapturedScreenshotEventArgs(null)); }; _effectBackground.Filtered += actionWhite; _effectBackground.Process(this, image); _effectBackgroundBlack = new EffectBackground(_effectBackground.X, _effectBackground.Y, _effectBackground.Width, _effectBackground.Height); _effectBackgroundBlack.SetBackground(new SolidColorBrush(Colors.Black)); _effectBackgroundBlack.Filtered += actionBlack; this.BothFiltered += ProcessTransparency; }
public EffectTransparentScreenshot(Fullscreen fs, FindWindows.Window window, int x, int y, int width, int height, EffectBackground background) { _fs = fs; _window = window; _x = x; _y = y; _width = width; _height = height; _effectBackground = background; }
public EffectScreenshot(Fullscreen fs, FindWindows.Window window, int x, int y, int width, int height, EffectBackground background) : this(fs, window, x, y, width, height) { _effectBackground = background; }
private void CaptureScreenshot() { int x = Convert.ToInt32(_capturedWindow.Position.X); int y = Convert.ToInt32(_capturedWindow.Position.Y); int width = Convert.ToInt32(_capturedWindow.Size.Width); int height = Convert.ToInt32(_capturedWindow.Size.Height); var background = new EffectBackground(x, y, width, height); background.SetBackground(new SolidColorBrush(Colors.White)); var screenshot = new EffectScreenshot(this, _capturedWindow, x, y, width, height, background); this.Filtered += screenshot.Process; screenshot.Filtered += (s, e) => OnCaptured(new CapturedScreenshotEventArgs(e.CapturedImage)); OnFiltered(null); }