Ejemplo n.º 1
0
        /// <summary>
        /// Adds a frame to this animation.
        /// </summary>
        public void WriteFrame(IBitmapFrame Frame, int Delay)
        {
            _gifStream.Position = 0;

            if (_firstFrame)
            {
                if (Frame is RepeatFrame)
                {
                    return;
                }

                _width  = Frame.Width;
                _height = Frame.Height;
            }

            if (!(Frame is RepeatFrame))
            {
                using (Frame)
                    Frame.SaveGif(_gifStream);
            }

            // Steal the global color table info
            if (_firstFrame)
            {
                InitHeader(_gifStream, _writer, _width, _height);
            }

            WriteGraphicControlBlock(_gifStream, _writer, Delay);
            WriteImageBlock(_gifStream, _writer, !_firstFrame, 0, 0, _width, _height);

            if (_firstFrame)
            {
                _firstFrame = false;
            }
        }
Ejemplo n.º 2
0
 public void SaveGif(Stream Stream)
 {
     _frame.SaveGif(Stream);
 }