当前位置: 首页>>代码示例>>C#>>正文


C# BufferedBinaryReader.ReadSBits方法代码示例

本文整理汇总了C#中SwfDotNet.IO.Utils.BufferedBinaryReader.ReadSBits方法的典型用法代码示例。如果您正苦于以下问题:C# BufferedBinaryReader.ReadSBits方法的具体用法?C# BufferedBinaryReader.ReadSBits怎么用?C# BufferedBinaryReader.ReadSBits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SwfDotNet.IO.Utils.BufferedBinaryReader的用法示例。


在下文中一共展示了BufferedBinaryReader.ReadSBits方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadData

        /// <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);
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:52,代码来源:ShapeRecord.cs

示例2: ReadData

 /// <summary>
 /// Reads the data.
 /// </summary>
 /// <param name="binaryReader">Binary reader.</param>
 public void ReadData(BufferedBinaryReader binaryReader)
 {
     base.SetStartPoint(binaryReader);
     binaryReader.SynchBits();
     bool hasScale = binaryReader.ReadBoolean();
     if (hasScale)
     {
         uint nScaleBits = binaryReader.ReadUBits(5);
         matrix[0, 0] = binaryReader.ReadFloat(nScaleBits);
         matrix[1, 1] = binaryReader.ReadFloat(nScaleBits);
     }
     bool hasRotate = binaryReader.ReadBoolean();
     if (hasRotate)
     {
         uint nRotateBits = binaryReader.ReadUBits(5);
         matrix[1, 0] = binaryReader.ReadFloat(nRotateBits);
         matrix[0, 1] = binaryReader.ReadFloat(nRotateBits);
     }
     uint nTranslateBits = binaryReader.ReadUBits(5);
     matrix[0, 2] = (float)binaryReader.ReadSBits(nTranslateBits);
     matrix[1, 2] = (float)binaryReader.ReadSBits(nTranslateBits);
     binaryReader.SynchBits();
     base.SetEndPoint(binaryReader);
 }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:28,代码来源:Matrix.cs

示例3: ReadData

        /// <summary>
        /// Reads the data from a binary file
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        public void ReadData(BufferedBinaryReader binaryReader)
        {
            base.SetStartPoint(binaryReader);

            uint nBits = binaryReader.ReadUBits(5);
            xMin = binaryReader.ReadSBits(nBits);
            xMax = binaryReader.ReadSBits(nBits);
            yMin = binaryReader.ReadSBits(nBits);
            yMax = binaryReader.ReadSBits(nBits);

            base.SetEndPoint(binaryReader);
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:16,代码来源:Rect.cs

示例4: ReadData

 /// <summary>
 /// Reads the data.
 /// </summary>
 /// <param name="binaryReader">Binary reader.</param>
 public void ReadData(BufferedBinaryReader binaryReader)
 {
     glyphIndex = binaryReader.ReadUBits(TextRecordCollection.GLYPH_BITS);
     glyphAdvance = binaryReader.ReadSBits(TextRecordCollection.ADVANCE_BITS);
 }
开发者ID:Berenold,项目名称:SwfExport,代码行数:9,代码来源:TextRecord.cs

示例5: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        public void ReadData(BufferedBinaryReader binaryReader)
        {
            hasAddTerms = binaryReader.ReadBoolean();
            hasMultTerms = binaryReader.ReadBoolean();
            uint nBits = binaryReader.ReadUBits(4);

            if (hasMultTerms)
            {
                int redMultTerms = binaryReader.ReadSBits(nBits);
                int greenMultTerms = binaryReader.ReadSBits(nBits);
                int blueMultTerms = binaryReader.ReadSBits(nBits);
            }

            if (hasAddTerms)
            {
                int redAddTerms = binaryReader.ReadSBits(nBits);
                int greenAddTerms = binaryReader.ReadSBits(nBits);
                int blueAddTerms = binaryReader.ReadSBits(nBits);
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:24,代码来源:CXForm.cs

示例6: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        public void ReadData(BufferedBinaryReader binaryReader)
        {
            bool hasAddTerms = binaryReader.ReadBoolean();
            bool hasMultTerms = binaryReader.ReadBoolean();
            uint nBits = binaryReader.ReadUBits(4);

            if (hasMultTerms)
            {
                redMultTerms = binaryReader.ReadSBits(nBits);
                greenMultTerms = binaryReader.ReadSBits(nBits);
                blueMultTerms = binaryReader.ReadSBits(nBits);
                alphaMultTerms = binaryReader.ReadSBits(nBits);
            }

            if (hasAddTerms)
            {
                redAddTerms = binaryReader.ReadSBits(nBits);
                greenAddTerms = binaryReader.ReadSBits(nBits);
                blueAddTerms = binaryReader.ReadSBits(nBits);
                alphaAddTerms = binaryReader.ReadSBits(nBits);
            }
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:26,代码来源:CXFormWithAlphaData.cs


注:本文中的SwfDotNet.IO.Utils.BufferedBinaryReader.ReadSBits方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。