Exemple #1
0
        public GifPlainText ReadPlainText()
        {
            AssertToken(Token.PlainText);
            currentStream.AssertByte(0x0c);

            var result = new GifPlainText();

            result.left            = currentStream.ReadInt16LittleEndian();
            result.top             = currentStream.ReadInt16LittleEndian();
            result.width           = currentStream.ReadInt16LittleEndian();
            result.height          = currentStream.ReadInt16LittleEndian();
            result.charWidth       = currentStream.ReadByte8();
            result.charHeight      = currentStream.ReadByte8();
            result.foregroundColor = globalColorTable[currentStream.ReadByte8()];
            result.backgroundColor = globalColorTable[currentStream.ReadByte8()];
            result.text            = Encoding.ASCII.GetString(BitUtils.ReadGifBlocks(currentStream));
            result.colors          = canvas.Colors;

            if (DrawPlainTextBackground)
            {
                FillPlainTextBackground(result);
            }

            DetermineNextToken();

            return(result);
        }
Exemple #2
0
        private void FillPlainTextBackground(GifPlainText text)
        {
            canvas.BeginNewFrame(text.left, text.top, text.width, text.height, globalColorTable,
                                 graphicControl.transparentColorIndex, imageDescriptor.isInterlaced, graphicControl.disposalMethod);

            canvas.FillWithColor(text.left, text.top,
                                 text.width, text.height, text.backgroundColor);
        }