當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。