Exemple #1
0
        internal GeneratorWorker(bool loop, int playbackFrameRate, ThreadPriority priority, FixedSizedQueue <GifFrame> capturedFrames, string filePath, Action onFileSaved)
        {
            _capturedFrames = capturedFrames;
            _filePath       = filePath;
            _onFileSaved    = onFileSaved;
            // 0: loop, -1 play once
            var repeat = loop ? 0 : -1;

            _encoder = new GifEncoder(repeat, 20);
            _encoder.SetFrameRate(playbackFrameRate);

            _thread = new Thread(Run)
            {
                Priority = priority
            };
        }
Exemple #2
0
 internal void Start()
 {
     _encoder = new GifEncoder(_repeat, 20);
     _encoder.SetFrameRate(_playbackFrameRate);
     _thread.Start();
 }