ReadData() public method

Reads the data.
public ReadData ( BufferedBinaryReader binaryReader, ShapeType shapeType ) : void
binaryReader SwfDotNet.IO.Utils.BufferedBinaryReader Binary reader.
shapeType ShapeType Shape type.
return void
Example #1
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
        {
            base.SetStartPoint(binaryReader);

            fillStyleArray = new FillStyleCollection();
            fillStyleArray.ReadData(binaryReader, shapeType);

            lineStyleArray = new LineStyleCollection();
            lineStyleArray.ReadData(binaryReader, shapeType);

            shapes = new ShapeRecordCollection();
            shapes.ReadData(binaryReader, shapeType);

            base.SetEndPoint(binaryReader);
        }
Example #2
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="flags">Flags.</param>
        /// <param name="numFillBits">Num fill bits.</param>
        /// <param name="numLineBits">Num line bits.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, byte flags,
                             ref byte numFillBits, ref byte numLineBits, ShapeType shapeType)
        {
            base.SetStartPoint(binaryReader);
            bool stateNewStyle   = ((flags & 0x10) != 0);
            bool stateLineStyle  = ((flags & 0x08) != 0);
            bool stateFillStyle1 = ((flags & 0x04) != 0);
            bool stateFillStyle0 = ((flags & 0x02) != 0);
            bool stateMoveTo     = ((flags & 0x01) != 0);

            if (stateMoveTo)
            {
                uint bits = binaryReader.ReadUBits(5);
                moveDeltaX = binaryReader.ReadSBits(bits);
                moveDeltaY = binaryReader.ReadSBits(bits);
            }
            if (stateFillStyle0)
            {
                fillStyle0 = (int)binaryReader.ReadUBits(numFillBits);
            }
            if (stateFillStyle1)
            {
                fillStyle1 = (int)binaryReader.ReadUBits(numFillBits);
            }
            if (stateLineStyle)
            {
                lineStyle = (int)binaryReader.ReadUBits(numLineBits);
            }

            fillStyles = null;
            lineStyles = null;

            if (stateNewStyle)
            {
                fillStyles = new FillStyleCollection();
                fillStyles.ReadData(binaryReader, shapeType);
                lineStyles = new LineStyleCollection();
                lineStyles.ReadData(binaryReader, shapeType);

                numFillBits = (byte)binaryReader.ReadUBits(4);
                numLineBits = (byte)binaryReader.ReadUBits(4);
            }
            base.SetEndPoint(binaryReader);
        }
Example #3
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="flags">Flags.</param>
        /// <param name="numFillBits">Num fill bits.</param>
        /// <param name="numLineBits">Num line bits.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, byte flags,
            ref byte numFillBits, ref byte numLineBits, ShapeType shapeType)
        {
            base.SetStartPoint(binaryReader);
            bool stateNewStyle = ((flags & 0x10) != 0);
            bool stateLineStyle = ((flags & 0x08) != 0);
            bool stateFillStyle1 = ((flags & 0x04) != 0);
            bool stateFillStyle0 = ((flags & 0x02) != 0);
            bool stateMoveTo = ((flags & 0x01) != 0);

            if  (stateMoveTo)
            {
                uint bits = binaryReader.ReadUBits(5);
                moveDeltaX = binaryReader.ReadSBits(bits);
                moveDeltaY = binaryReader.ReadSBits(bits);
            }
            if (stateFillStyle0)
            {
                fillStyle0 = (int)binaryReader.ReadUBits(numFillBits);
            }
            if (stateFillStyle1)
            {
                fillStyle1 = (int)binaryReader.ReadUBits(numFillBits);
            }
            if (stateLineStyle)
            {
                lineStyle = (int)binaryReader.ReadUBits(numLineBits);
            }

            fillStyles = null;
            lineStyles = null;

            if (stateNewStyle)
            {
                fillStyles = new FillStyleCollection();
                fillStyles.ReadData(binaryReader, shapeType);
                lineStyles = new LineStyleCollection();
                lineStyles.ReadData(binaryReader, shapeType);

                numFillBits = (byte)binaryReader.ReadUBits(4);
                numLineBits = (byte)binaryReader.ReadUBits(4);
            }
            base.SetEndPoint(binaryReader);
        }
Example #4
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
        {
            base.SetStartPoint(binaryReader);

            fillStyleArray = new FillStyleCollection();
            fillStyleArray.ReadData(binaryReader, shapeType);

            lineStyleArray = new LineStyleCollection();
            lineStyleArray.ReadData(binaryReader, shapeType);

            shapes = new ShapeRecordCollection();
            shapes.ReadData(binaryReader, shapeType);

            base.SetEndPoint(binaryReader);
        }