示例#1
0
            private void SafeRelease()
            {
                if (ImageSaver != null)
                {
                    ImageSaver.Dispose();
                }
                ImageSaver = null;

                if (VideoSaver != null)
                {
                    VideoSaver.Dispose();
                }
                VideoSaver = null;
            }
示例#2
0
            public Context(DxRender.DxDeviceContext devices, CaptureSettings settings)
            {
                IFileNamingTemplate fnt = new DateTimeFileNamingTemplate(settings.OutDirectory, settings.NamePrefix);

                KeyValuePair <int, int> iSize = CaptureOptions.ToValue(settings.ImageSize);

                ImageWidth  = iSize.Key;
                ImageHeight = iSize.Value;
                ImageSaver  = new ImageSaver(fnt, settings.ImageContainer);

                KeyValuePair <int, int> vSize = CaptureOptions.ToValue(settings.VideoSize);

                VideoWidth  = vSize.Key;
                VideoHeight = vSize.Value;
                VideoSaver  = new VideoSaver(fnt, settings.VideoSize, settings.VideoFPS, settings.VideoCompression);

                StateProviders = new List <IStateProvider>();
                StateProviders.Add(new DelegateStateProvider <bool>(StateType.IsVideoRecording, IsVideoCapturing));
            }