Recurity.Swf.Rgba.Parse C# (CSharp) Method

Parse() public method

Parses this object out of a stream
public Parse ( Stream input ) : void
input Stream The input stream.
return void
        public override void Parse( Stream input )
        {
            base.Parse( input );
            BinaryReader br = new BinaryReader( input );
            _Alpha = br.ReadByte();
            //String s = string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", _Red, _Green, _Blue, _Alpha);
            //Log.Debug(this, "[Begin Structure] RGBA : color=" + s);
            //Log.Debug(this, "[End Structure] RGBA");
        }

Usage Example

示例#1
0
        /// <summary>
        /// Parses this object out of a stream
        /// </summary>
        /// <param name="input">The input stream.</param>
        /// <param name="colorTableSize"></param>
        /// <param name="imageDataSize"></param>
        public override void Parse( Stream input, byte colorTableSize, UInt32 imageDataSize )
        {
            Rgba temp = null;

            for (int i = 0; i <= colorTableSize; i++) // BitmapColorTableSize + 1.
            {
                temp = new Rgba( this._SwfVersion );
                temp.Parse( input );
                this._colorTableRGB.Add(temp);
            }

            this._colormapPixelData = new byte[(Int32)imageDataSize];
            int read = input.Read( this._colormapPixelData, 0, (Int32)imageDataSize );
        }