예제 #1
0
 /// <summary>Resets the frame state before reading the next image</summary>
 protected void ResetFrame()
 {
     lastDispose     = dispose;
     lastImage       = image;
     lastBgColor     = bgColor;
     transparency    = false;
     delay           = 0;
     localColorTable = null;
     dispose         = DisposeMode.NoAction;
 }
예제 #2
0
        /// <summary>Reads the Graphic Control Extension values</summary>
        protected void ReadGraphicControlExt()
        {
            Read();                                        // block size
            int packed = Read();                           // packed fields

            dispose = (DisposeMode)((packed & 0x1c) >> 2); // disposal method
            if (dispose == DisposeMode.NoAction)
            {
                dispose = DisposeMode.LeaveInPlace;                 // elect to keep old image if discretionary
            }
            transparency = (packed & 1) != 0;
            delay        = ReadShort() * 10; // delay in milliseconds
            transIndex   = Read();           // transparent color index
            Read();                          // block terminator
        }