private int ParseBlock(byte[] gifData, int offset) { switch (gifData[offset]) { case 33: if ((int)gifData[offset + 1] == 249) { return(this.ParseGraphicControlExtension(gifData, offset)); } return(this.ParseExtensionBlock(gifData, offset)); case 44: offset = this.ParseGraphicBlock(gifData, offset); this.frameList.Add(this.currentParseGifFrame); this.currentParseGifFrame = new GifAnimation.GifFrame(); return(offset); case 59: return(-1); default: throw new Exception("GIF format incorrect: missing graphic block or special-purpose block. "); } }
private void ParseGif(byte[] gifData) { this.frameList = new List <GifAnimation.GifFrame>(); this.currentParseGifFrame = new GifAnimation.GifFrame(); this.ParseGifDataStream(gifData, 0); }