/// <summary> /// <para>Swf 8 and later supports up to 15 gradient control points, spread modes and a new</para> /// <para>interpolation type.</para> /// </summary> /// <param name="InitialVersion">The version of the Swf file using this object.</param> public Gradient( byte InitialVersion ) : base(InitialVersion) { this._spreadMode = SpreadMode.PadMode; this._interpolationMode = InterPolation.Linear; this._numGradients = 0; this._gradientRecords = new List<GradRecord>(); }
/// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="caller"></param> public virtual void Parse( Stream input, TagTypes caller ) { BitStream bits = new BitStream( input ); GradRecord temp = new GradRecord(this._SwfVersion); this._spreadMode = ( SpreadMode )bits.GetBits( 2 ); this._interpolationMode = ( InterPolation )bits.GetBits( 2 ); this._numGradients = ( byte )bits.GetBits( 4 ); bits.Reset(); for ( int i = 0; i < this._numGradients; i++ ) { temp = new GradRecord( this._SwfVersion ); temp.Parse( input, caller ); this._gradientRecords.Add( temp ); } }