示例#1
0
        internal static GifHeader ReadHeader(Stream stream)
        {
            var header = new GifHeader();

            header.Read(stream);
            return(header);
        }
示例#2
0
        private void Read(Stream stream, bool metadataOnly)
        {
            this.Header = GifHeader.ReadHeader(stream);
            if (this.Header.LogicalScreenDescriptor.HasGlobalColorTable)
            {
                this.GlobalColorTable = GifHelpers.ReadColorTable(stream, this.Header.LogicalScreenDescriptor.GlobalColorTableSize);
            }
            this.ReadFrames(stream, metadataOnly);
            GifApplicationExtension ext = this.Extensions.OfType <GifApplicationExtension>().FirstOrDefault <GifApplicationExtension>(new Func <GifApplicationExtension, bool>(GifHelpers.IsNetscapeExtension));

            if (ext != null)
            {
                this.RepeatCount = GifHelpers.GetRepeatCount(ext);
            }
            else
            {
                this.RepeatCount = 1;
            }
        }
示例#3
0
        private void Read(Stream stream, bool metadataOnly)
        {
            Header = GifHeader.ReadHeader(stream);

            if (Header.LogicalScreenDescriptor.HasGlobalColorTable)
            {
                GlobalColorTable = GifHelpers.ReadColorTable(stream, Header.LogicalScreenDescriptor.GlobalColorTableSize);
            }
            ReadFrames(stream, metadataOnly);

            var netscapeExtension =
                Extensions
                .OfType <GifApplicationExtension>()
                .FirstOrDefault(GifHelpers.IsNetscapeExtension);

            if (netscapeExtension != null)
            {
                RepeatCount = GifHelpers.GetRepeatCount(netscapeExtension);
            }
            else
            {
                RepeatCount = 1;
            }
        }
示例#4
0
 internal static GifHeader ReadHeader(Stream stream)
 {
     var header = new GifHeader();
     header.Read(stream);
     return header;
 }