private void ParseGif(byte[] gifData) { this._frameList = new List<GifFrame>(); this._currentParseGifFrame = new GifFrame(); this.ParseGifDataStream(gifData, 0); }
private int ParseBlock(byte[] gifData, int offset) { switch (gifData[offset]) { case 0x21: if (gifData[offset + 1] == 0xf9) { return this.ParseGraphicControlExtension(gifData, offset); } return this.ParseExtensionBlock(gifData, offset); case 0x2c: offset = this.ParseGraphicBlock(gifData, offset); this._frameList.Add(this._currentParseGifFrame); this._currentParseGifFrame = new GifFrame(); return offset; case 0x3b: return -1; } throw new Exception("GIF format incorrect: missing graphic block or special-purpose block. "); }