Esempio n. 1
0
        /// <summary>
        /// Reads a GIF file from the specified stream.
        /// </summary>
        /// <param name="inputStream">
        /// A stream to read the GIF data from.
        /// </param>
        /// <param name="xmlDebugging">
        /// A boolean value indicating whether or not an XML document should be
        /// created showing how the GIF stream was decoded.
        /// </param>
        public GifDecoder(Stream inputStream, bool xmlDebugging)
            : base(xmlDebugging)
        {
            if (inputStream == null)
            {
                throw new ArgumentNullException("inputStream");
            }

            if (inputStream.CanRead == false)
            {
                string message
                    = "The supplied stream cannot be read";
                throw new ArgumentException(message, "inputStream");
            }
            _stream = inputStream;
            _state  = GifDecoderState.NotStarted;
        }
Esempio n. 2
0
 /// <summary>
 /// Decodes the supplied GIF stream.
 /// </summary>
 public void Decode()
 {
     _state = GifDecoderState.Decoding;
     ReadStream(_stream);
     _state = GifDecoderState.Done;
 }
Esempio n. 3
0
 /// <summary>
 /// Decodes the supplied GIF stream.
 /// </summary>
 public void Decode()
 {
     _state = GifDecoderState.Decoding;
     ReadStream( _stream );
     _state = GifDecoderState.Done;
 }
Esempio n. 4
0
        /// <summary>
        /// Reads a GIF file from the specified stream.
        /// </summary>
        /// <param name="inputStream">
        /// A stream to read the GIF data from.
        /// </param>
        /// <param name="xmlDebugging">
        /// A boolean value indicating whether or not an XML document should be 
        /// created showing how the GIF stream was decoded.
        /// </param>
        public GifDecoder( Stream inputStream, bool xmlDebugging )
            : base(xmlDebugging)
        {
            if( inputStream == null )
            {
                throw new ArgumentNullException( "inputStream" );
            }

            if( inputStream.CanRead == false )
            {
                string message
                    = "The supplied stream cannot be read";
                throw new ArgumentException( message, "inputStream" );
            }
            _stream = inputStream;
            _state = GifDecoderState.NotStarted;
        }