Recurity.Swf.MorphGradRecord.Parse C# (CSharp) 메소드

Parse() 공개 메소드

Parses this object out of a stream
public Parse ( Stream input ) : void
input Stream The stream to read from
리턴 void
        public void Parse(Stream input)
        {
            BinaryReader br = new BinaryReader(input);

            this._startRatio = br.ReadByte();
            this._startColor.Parse(input);
            this._endRatio = br.ReadByte();
            this._endColor.Parse(input);
        }

Usage Example

예제 #1
0
        /// <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;
            }
        }