ScreenToGif.ImageUtil.Decoder.GifImageDescriptor.Read C# (CSharp) Method

Read() private method

private Read ( Stream stream ) : void
stream Stream
return void
        private void Read(Stream stream)
        {
            byte[] bytes = new byte[9];
            stream.ReadAll(bytes, 0, bytes.Length);
            Left = BitConverter.ToUInt16(bytes, 0);
            Top = BitConverter.ToUInt16(bytes, 2);
            Width = BitConverter.ToUInt16(bytes, 4);
            Height = BitConverter.ToUInt16(bytes, 6);
            byte packedFields = bytes[8];
            HasLocalColorTable = (packedFields & 0x80) != 0;
            Interlace = (packedFields & 0x40) != 0;
            IsLocalColorTableSorted = (packedFields & 0x20) != 0;
            LocalColorTableSize = 1 << ((packedFields & 0x07) + 1);
        }
    }

Usage Example

        public static GifImageDescriptor ReadImageDescriptor(Stream stream)
        {
            var descriptor = new GifImageDescriptor();

            descriptor.Read(stream);
            return(descriptor);
        }
All Usage Examples Of ScreenToGif.ImageUtil.Decoder.GifImageDescriptor::Read