/// <summary> /// Parses this object out of a stream /// </summary> /// <param name="input">The stream to read from</param> public void Parse(Stream input) { BinaryReader br = new BinaryReader(input); this._numGradients = br.ReadByte(); if (1 > this._numGradients || 8 < this._numGradients) { SwfFormatException e = new SwfFormatException("Illegal number of gradients! The number of grad records must be between 1 and 8. This Gradient has " + this._numGradients + " grad records. Skipping."); Log.Warn(this, e.Message); throw e; } this._gradientRecords = new MorphGradRecord[this._numGradients]; for (byte i = 0; i < this._numGradients; i++) { MorphGradRecord mg = new MorphGradRecord(this._SwfVersion); mg.Parse(input); this._gradientRecords[i] = mg; } }