public ImageSaver(IFileNamingTemplate fileNaming, CaptureOptions.ImageContainer container) { _fileNaming = fileNaming; var formatAndExt = CaptureOptions.ToValue(container); _format = formatAndExt.Key; _fileExt = formatAndExt.Value; }
public VideoSaver(IFileNamingTemplate fileNaming, CaptureOptions.VideoSize frameSize, CaptureOptions.VideoFPS FPS, CaptureOptions.VideoCompression compression) { KeyValuePair <int, int> size = CaptureOptions.ToValue(frameSize); _fileNaming = fileNaming; _frameWidth = size.Key; _frameHeight = size.Value; _FPS = CaptureOptions.ToValue(FPS); _compression = compression; _buffer = null; _dxPlay = null; }
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)); }