예제 #1
0
        public void WriteToStreamNoFramesTest()
        {
            ReportStart();
            _e = new AnimatedGifEncoder();
            MemoryStream s = new MemoryStream();

            try
            {
                _e.WriteToStream(s);
            }
            catch (InvalidOperationException ex)
            {
                string message
                    = "The AnimatedGifEncoder has no frames to write!";
                StringAssert.Contains(message, ex.Message);
                ReportEnd();
                throw;
            }
        }
예제 #2
0
        public void DecodeEncodeSmileyLocal()
        {
            ReportStart();
            string filename = @"images/smiley/smiley.gif";

            _d = new GifDecoder(filename);
            _d.Decode();
            _e = new AnimatedGifEncoder();
            _e.ColourTableStrategy = ColourTableStrategy.UseLocal;
            foreach (GifFrame f in _d.Frames)
            {
                _e.AddFrame(new GifFrame(f.TheImage));
            }
            MemoryStream s = new MemoryStream();

            _e.WriteToStream(s);
            s.Seek(0, SeekOrigin.Begin);
            _d = new GifDecoder(s);
            _d.Decode();
            CheckFrames();
            ReportEnd();
        }
예제 #3
0
        public void DecodeEncodeGlobeLocal()
        {
            ReportStart();
            string filename = @"images/globe/spinning globe better 200px transparent background.gif";

            _d = new GifDecoder(filename);
            _d.Decode();
            _e = new AnimatedGifEncoder();
            _e.ColourTableStrategy = ColourTableStrategy.UseLocal;
            foreach (GifFrame f in _d.Frames)
            {
                _e.AddFrame(new GifFrame(f.TheImage));
            }
            MemoryStream s = new MemoryStream();

            _e.WriteToStream(s);
            s.Seek(0, SeekOrigin.Begin);
            _d = new GifDecoder(s);
            _d.Decode();
            CheckFrames();
            ReportEnd();
        }
 public void WriteToStreamNoFramesTest()
 {
     ReportStart();
     _e = new AnimatedGifEncoder();
     MemoryStream s = new MemoryStream();
     try
     {
         _e.WriteToStream( s );
     }
     catch( InvalidOperationException ex )
     {
         string message
             = "The AnimatedGifEncoder has no frames to write!";
         StringAssert.Contains( message, ex.Message );
         ReportEnd();
         throw;
     }
 }
 public void DecodeEncodeSmileyLocal()
 {
     ReportStart();
     string filename = @"images/smiley/smiley.gif";
     _d = new GifDecoder( filename );
     _d.Decode();
     _e = new AnimatedGifEncoder();
     _e.ColourTableStrategy = ColourTableStrategy.UseLocal;
     foreach( GifFrame f in _d.Frames )
     {
         _e.AddFrame( new GifFrame( f.TheImage ) );
     }
     MemoryStream s = new MemoryStream();
     _e.WriteToStream( s );
     s.Seek( 0, SeekOrigin.Begin );
     _d = new GifDecoder( s );
     _d.Decode();
     CheckFrames();
     ReportEnd();
 }
 public void DecodeEncodeGlobeLocal()
 {
     ReportStart();
     string filename = @"images/globe/spinning globe better 200px transparent background.gif";
     _d = new GifDecoder( filename );
     _d.Decode();
     _e = new AnimatedGifEncoder();
     _e.ColourTableStrategy = ColourTableStrategy.UseLocal;
     foreach( GifFrame f in _d.Frames )
     {
         _e.AddFrame( new GifFrame( f.TheImage ) );
     }
     MemoryStream s = new MemoryStream();
     _e.WriteToStream( s );
     s.Seek( 0, SeekOrigin.Begin );
     _d = new GifDecoder( s );
     _d.Decode();
     CheckFrames();
     ReportEnd();
 }