/// <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; }
/// <summary> /// Decodes the supplied GIF stream. /// </summary> public void Decode() { _state = GifDecoderState.Decoding; ReadStream(_stream); _state = GifDecoderState.Done; }
/// <summary> /// Decodes the supplied GIF stream. /// </summary> public void Decode() { _state = GifDecoderState.Decoding; ReadStream( _stream ); _state = GifDecoderState.Done; }
/// <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; }