internal void Read(GifReader reader)
        {
            left = reader.ReadUInt16();
            top  = reader.ReadUInt16();

            width  = reader.ReadUInt16();
            height = reader.ReadUInt16();

            Byte flags = reader.ReadByte();

            localColorTableFlag   = 0x80 == (flags & 0x80);
            interlaced            = 0x40 == (flags & 0x40);
            localColorTableSorted = 0x20 == (flags & 0x20);
            localColorTableSize   = (UInt16)(2 << (flags & 0x07));
        }
        internal void Read(GifReader reader)
        {
            width  = reader.ReadUInt16();
            height = reader.ReadUInt16();

            Byte flags = reader.ReadByte();

            globalColorTableFlag   = 0x80 == (flags & 0x80);
            colorResolution        = (Byte)(((flags & 0x70) >> 4) + 1);
            globalColorTableSorted = 0x08 == (flags & 0x08);
            globalColorTableSize   = (UInt16)(2 << (flags & 0x07));

            backgroundColorIndex = reader.ReadByte();
            pixelAspectRatio     = reader.ReadByte();
        }
        internal void Read(GifReader reader)
        {
            Byte size = reader.ReadByte();

            if (size != 4)
            {
                System.Diagnostics.Debug.WriteLine("Wrong size of " + ToString());
            }

            Byte flags = reader.ReadByte();

            disposalMethod    = (GifDisposalMethod)((flags & 0x1C) >> 2);
            userInputExpected = 0x02 == (flags & 0x02);
            transparency      = 0x01 == (flags & 0x01);

            delay             = reader.ReadUInt16();
            transparencyIndex = reader.ReadByte();

            Byte terminator = reader.ReadByte();

            if (terminator != 0x00)
            {
                throw new Exception("Unknown extension terminator: 0x" + terminator.ToString("X2"));
            }
        }
示例#4
0
        internal void Read(GifReader reader)
        {
            Byte size = reader.ReadByte();

            if (size != 12)
            {
                System.Diagnostics.Debug.WriteLine("Wrong size of " + ToString());
            }

            left   = reader.ReadUInt16();
            top    = reader.ReadUInt16();
            width  = reader.ReadUInt16();
            height = reader.ReadUInt16();

            cellWidth  = reader.ReadByte();
            cellHeight = reader.ReadByte();

            foregroundColor = reader.ReadByte();
            backgroundColor = reader.ReadByte();

            text = reader.ReadTextSubBlocks();
        }