Пример #1
0
        /// <summary>
        /// Reads the frame indices marking the color to use for each pixel.
        /// </summary>
        /// <param name="imageDescriptor">The <see cref="GifImageDescriptor"/>.</param>
        /// <returns>The <see cref="T:byte[]"/></returns>
        private byte[] ReadFrameIndices(GifImageDescriptor imageDescriptor)
        {
            int        dataSize   = this.currentStream.ReadByte();
            LzwDecoder lzwDecoder = new LzwDecoder(this.currentStream);

            byte[] indices = lzwDecoder.DecodePixels(imageDescriptor.Width, imageDescriptor.Height, dataSize);

            return(indices);
        }
Пример #2
0
        private void ReadFrameIndices(GifImageDescriptor imageDescriptor, byte[] indices)
        {
            int dataSize = this.currentStream.ReadByte();

            using (var lzwDecoder = new LzwDecoder(this.currentStream))
            {
                lzwDecoder.DecodePixels(imageDescriptor.Width, imageDescriptor.Height, dataSize, indices);
            }
        }