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;
        }
示例#2
0
        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;
        }
示例#3
0
        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);
        }