Beispiel #1
0
        public IBitmapImage ScreenShotWindow(IWindow Window)
        {
            _systemTray.HideNotification();

            if (Window.Handle == _platformServices.DesktopWindow.Handle)
            {
                return(ScreenShot.Capture(_settings.IncludeCursor));
            }

            try
            {
                IBitmapImage bmp = null;

                if (_settings.ScreenShots.WindowShotTransparent)
                {
                    bmp = ScreenShot.CaptureTransparent(Window, _settings.IncludeCursor);
                }

                // Capture without Transparency
                return(bmp ?? ScreenShot.Capture(Window.Rectangle, _settings.IncludeCursor));
            }
            catch
            {
                return(null);
            }
        }
Beispiel #2
0
        void OnPauseExecute()
        {
            if (RecorderState == RecorderState.Paused)
            {
                _systemTray.HideNotification();

                _recorder.Start();
                _timing?.Start();
                _timer?.Start();

                RecorderState          = RecorderState.Recording;
                Status.LocalizationKey = nameof(LanguageManager.Recording);
            }
            else
            {
                _recorder.Stop();
                _timer?.Stop();
                _timing?.Pause();

                RecorderState          = RecorderState.Paused;
                Status.LocalizationKey = nameof(LanguageManager.Paused);

                _systemTray.ShowTextNotification(Loc.Paused, null);
            }
        }
Beispiel #3
0
        public Bitmap ScreenShotWindow(IWindow hWnd)
        {
            _systemTray.HideNotification();

            if (hWnd.Handle == Window.DesktopWindow.Handle)
            {
                return(ScreenShot.Capture(Settings.IncludeCursor).Transform(Settings.ScreenShots));
            }

            var bmp = ScreenShot.CaptureTransparent(hWnd,
                                                    Settings.IncludeCursor,
                                                    Settings.ScreenShots.Resize,
                                                    Settings.ScreenShots.ResizeWidth,
                                                    Settings.ScreenShots.ResizeHeight);

            // Capture without Transparency
            if (bmp == null)
            {
                try
                {
                    return(ScreenShot.Capture(hWnd, Settings.IncludeCursor)?.Transform(Settings.ScreenShots));
                }
                catch
                {
                    return(null);
                }
            }

            return(bmp.Transform(Settings.ScreenShots, true));
        }
        public Bitmap ScreenShotWindow(IWindow Window)
        {
            _systemTray.HideNotification();

            if (Window.Handle == Screna.Window.DesktopWindow.Handle)
            {
                return(ScreenShot.Capture(Settings.IncludeCursor));
            }

            try
            {
                Bitmap bmp = null;

                if (Settings.ScreenShots.WindowShotTransparent)
                {
                    bmp = ScreenShot.CaptureTransparent(Window, Settings.IncludeCursor);
                }

                // Capture without Transparency
                return(bmp ?? ScreenShot.Capture(Window, Settings.IncludeCursor));
            }
            catch
            {
                return(null);
            }
        }
Beispiel #5
0
        void StartRecording()
        {
            _systemTray.HideNotification();

            if (_recordingModel.StartRecording(new RecordingModelParams
            {
                VideoSourceKind = _videoSourcesViewModel.SelectedVideoSourceKind,
                VideoWriter = Settings.Video.RecorderMode == RecorderMode.Steps
                    ? _videoWritersViewModel.SelectedStepsWriter
                    : _videoWritersViewModel.SelectedVideoWriter,
                Microphone = Settings.Audio.RecordMicrophone ? _audioSourceViewModel.SelectedMicrophone : null,
                Speaker = Settings.Audio.RecordSpeaker ? _audioSourceViewModel.SelectedSpeaker : null
            }))
            {
                if (Settings.Tray.MinToTrayOnCaptureStart)
                {
                    _mainWindow.IsVisible = false;
                }

                _audioPlayer.Play(SoundKind.Start);
            }
            else
            {
                _audioPlayer.Play(SoundKind.Error);
            }
        }
Beispiel #6
0
        async void OnRecordExecute()
        {
            if (RecorderState.Value == Models.RecorderState.NotRecording)
            {
                _systemTray.HideNotification();

                if (_recordingModel.StartRecording())
                {
                    if (Settings.Tray.MinToTrayOnCaptureStart)
                    {
                        _mainWindow.IsVisible = false;
                    }

                    _audioPlayer.Play(SoundKind.Start);
                }
                else
                {
                    _audioPlayer.Play(SoundKind.Error);
                }
            }
            else
            {
                _audioPlayer.Play(SoundKind.Stop);

                await _recordingModel.StopRecording();
            }
        }
        void StartRecording()
        {
            _systemTray.HideNotification();

            if (_recordingModel.StartRecording(new RecordingModelParams
            {
                VideoSourceKind = _videoSourcesViewModel.SelectedVideoSourceKind,
                VideoWriter = _videoWritersViewModel.SelectedVideoWriter,
                AudioItems = _audioSourceViewModel.AvailableRecordingSources
            }))
            {
                if (Settings.Tray.MinToTrayOnCaptureStart)
                {
                    _mainWindow.IsVisible = false;
                }

                _audioPlayer.Play(SoundKind.Start);
            }
            else
            {
                _audioPlayer.Play(SoundKind.Error);
            }
        }