public GifAnimationGenerator(Size size, int loopCount = InfinityLoop) {
            var descriptor = new GifLogicalScreenDescriptor();
            descriptor.BitsPerColorChannel = 8;
            descriptor.GlobalColorTableIsSorted = false;
            descriptor.HasGlobalColorTable = false;
            descriptor.PixelAspectRatio = 1;
            descriptor.SizeOfGlobalColorTable = 2;
            descriptor.Raw_Width = (UInt16)size.Width;
            descriptor.Raw_Height = (UInt16)size.Height;
            _structure = new GifStructure(descriptor);

            var appExtBlock = new GifApplicationExtensionBlock();
            appExtBlock.Raw_ApplicationIdentifier = "NETSCAPE";
            appExtBlock.Raw_ApplicationAuthenticationCode = "2.0";
            var loopCountH = (byte)((loopCount >> 8) & 0xff);
            var loopCountL = (byte)((loopCount >> 0) & 0xff);
            appExtBlock.Raw_Data = new byte[] { 0x01, loopCountL, loopCountH };
            _structure.Blocks.Add(appExtBlock);
        }
Ejemplo n.º 2
0
 public GifStructure(GifLogicalScreenDescriptor descriptor) {
     this.Descriptor = descriptor;
 }
Ejemplo n.º 3
0
 public void Dispose() {
     this.Blocks.Clear();
     this.Blocks = null;
     this.Descriptor = null;
     this.Raw_GlobalColorTable = null;
     
 }