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


C# Tags.RecordHeader类代码示例

本文整理汇总了C#中SwfDotNet.IO.Tags.RecordHeader的典型用法代码示例。如果您正苦于以下问题:C# RecordHeader类的具体用法?C# RecordHeader怎么用?C# RecordHeader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RecordHeader类属于SwfDotNet.IO.Tags命名空间,在下文中一共展示了RecordHeader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            int tl = System.Convert.ToInt32(rh.TagLength);
            Meta = binaryReader.ReadString();
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:11,代码来源:MetadataTag.cs

示例2: UpdateData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            MemoryStream m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            RecordHeader rh = new RecordHeader(TagCode, GetSizeOf());

            rh.WriteTo(w);
            if (Meta != null)
                w.Write(Meta);

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:18,代码来源:MetadataTag.cs

示例3: UpdateData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            if (version < 6)
                return;

            MemoryStream m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            RecordHeader rh = new RecordHeader(TagCode, GetSizeOf(), true);

            rh.WriteTo(w);
            w.Write(this.fontId);
            w.Write((byte)this.fontName.Length);
            if (fontName != null)
                w.WriteString(this.fontName, (uint)this.fontName.Length);

            w.WriteUBits(0, 2);
            w.WriteBoolean(fontFlagsSmallText);
            w.WriteUBits(0, 2);
            w.WriteBoolean(fontFlagsItalic);
            w.WriteBoolean(fontFlagsBold);
            w.WriteBoolean(true);

            w.Write(this.languageCode);
            if (codeTable != null)
            {
                IEnumerator glyphs = codeTable.GetEnumerator();
                while (glyphs.MoveNext())
                    w.Write((ushort)glyphs.Current);
            }

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:38,代码来源:DefineFontInfo2Tag.cs

示例4: ReadData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            soundId = binaryReader.ReadUInt16();

            soundFormat = binaryReader.ReadUBits(4);
            soundRate = binaryReader.ReadUBits(2);
            soundSize = binaryReader.ReadUBits(1);
            soundType = binaryReader.ReadUBits(1);

            soundSampleCount = binaryReader.ReadUInt32();

            uint size = rh.TagLength - 2 - 1 - 4;
            soundData = new byte[size];
            for (uint i = 0; i < size; i++)
                soundData[i] = binaryReader.ReadByte();
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:22,代码来源:DefineSoundTag.cs

示例5: ReadData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            characterId = binaryReader.ReadUInt16();
            binaryReader.SynchBits();

            startBounds = new Rect();
            startBounds.ReadData(binaryReader);

            binaryReader.SynchBits();
            endBounds = new Rect();
            endBounds.ReadData(binaryReader);
            binaryReader.SynchBits();

            offset = binaryReader.ReadUInt32();

            morphFillStyles = new MorphFillStyleCollection();
            morphFillStyles.ReadData(binaryReader);

            morphLineStyles = new MorphLineStyleCollection();
            morphLineStyles.ReadData(binaryReader);

            ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
            ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;

            startEdges = new ShapeRecordCollection();
            startEdges.ReadData(binaryReader, ShapeType.None);

            ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
            ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;

            endEdges = new ShapeRecordCollection();
            endEdges.ReadData(binaryReader, ShapeType.None);
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:39,代码来源:DefineMorphShapeTag.cs

示例6: ReadData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            int beforePos = (int)binaryReader.BaseStream.Position;
            int toReaded = (int)rh.TagLength - 7;

            _characterId = binaryReader.ReadUInt16();
            _bitmapFormat = binaryReader.ReadByte();
            _bitmapWidth = binaryReader.ReadUInt16();
            _bitmapHeight = binaryReader.ReadUInt16();
            _bitmapColorTableSize = 0;

            if (_bitmapFormat == 3)
            {
                _bitmapColorTableSize = binaryReader.ReadByte();
                toReaded--;
            }

            if (_bitmapFormat == 3)
            {
                _colorMapData = new ColorMapData();
                _colorMapData.ReadData(binaryReader, _bitmapColorTableSize, _bitmapWidth, _bitmapHeight, toReaded);
            }
            else if (_bitmapFormat == 4 || _bitmapFormat == 5)
            {
                int imageSize = _bitmapWidth * _bitmapHeight;
                int uncompressedSize = imageSize;
                if (_bitmapFormat == 4)
                    uncompressedSize *= 2;
                else
                    uncompressedSize *= 4;

                byte[] uncompressed = new byte[uncompressedSize];
                byte[] compressed = binaryReader.ReadBytes(toReaded);
                Inflater zipInflator = 	new Inflater();
                zipInflator.SetInput(compressed);
                zipInflator.Inflate(uncompressed, 0, uncompressedSize);

                _bitmapColorData = null;
                if (_bitmapFormat == 4)
                {
                    Pix15[] bitmapPixelData = new Pix15[imageSize];
                    for (int i = 0, j = 0; i < imageSize; i++, j += 2)
                    {
                        byte[] data = new byte[2] {uncompressed[j], uncompressed[j+1]};
                        bitmapPixelData[i] = new Pix15(data);
                    }
                    _bitmapColorData = new BitmapColorData(bitmapPixelData);
                }
                else
                {
                    Pix24[] bitmapPixelData = new Pix24[imageSize];
                    for (int i = 0, j = 0; i < imageSize; i++, j += 4)
                    {
                        byte reserved = uncompressed[j];
                        byte red = uncompressed[j + 1];
                        byte green = uncompressed[j + 2];
                        byte blue = uncompressed[j + 3];
                        bitmapPixelData[i] = new Pix24(red, green, blue);
                    }
                    _bitmapColorData = new BitmapColorData(bitmapPixelData);
                }
            }
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:69,代码来源:DefineBitsLossLessTag.cs

示例7: UpdateData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            if (version < 3)
                return;

            MemoryStream m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            RecordHeader rh = new RecordHeader(TagCode, GetSizeOf());

            rh.WriteTo(w);
            w.Write(this.buttonId);
            w.WriteUBits(0, 7);
            w.WriteBoolean(trackAsMenu);
            w.Write(this.actionOffset);
            if (characters != null)
            {
                IEnumerator butts = characters.GetEnumerator();
                while (butts.MoveNext())
                {
                    ((ButtonRecord)butts.Current).WriteTo(w, TagCodeEnum.DefineButton2);
                    w.SynchBits();
                }
            }
            w.Write((byte)0);
            if (actions != null)
            {
                for (int i = 0; i < actions.Count; i++)
                {
                    ButtonCondaction buttCon = actions[i];
                    if (i == actions.Count - 1)
                        w.Write((ushort)0);
                    else
                    {
                        int size = buttCon.GetSizeOf();
                        w.Write((ushort)size);
                    }
                    buttCon.WriteTo(w);
                }
            }

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:48,代码来源:DefineButton2Tag.cs

示例8: UpdateData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            if (version < 5)
                return;

            MemoryStream m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            RecordHeader rh = new RecordHeader(TagCode, GetSizeOf());
            rh.WriteTo(w);

            if (exportedCharacters != null)
                w.Write((ushort)exportedCharacters.Count);
            else
                w.Write((ushort)0);

            if (exportedCharacters != null)
            {
                IEnumerator assertEnu = exportedCharacters.GetEnumerator();
                while (assertEnu.MoveNext())
                {
                    Assert assert = (Assert)assertEnu.Current;
                    assert.WriteTo(w);
                }
            }

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:33,代码来源:ExportAssetsTag.cs

示例9: UpdateData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            if (version < 7)
                return;

            MemoryStream m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            RecordHeader rh = new RecordHeader(TagCode, 4);

            rh.WriteTo(w);
            w.Write(recursion);
            w.Write(timeout);

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:21,代码来源:ScriptLimitTag.cs

示例10: ReadData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            long initPos = binaryReader.BaseStream.Position;

            characterId = binaryReader.ReadUInt16();
            depth = binaryReader.ReadUInt16();
            matrix = new Matrix();
            matrix.ReadData(binaryReader);

            long pos = binaryReader.BaseStream.Position - initPos;
            if (pos < rh.TagLength)
            {
                colorTransform = new CXForm();
                colorTransform.ReadData(binaryReader);
            }
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:22,代码来源:PlaceObjectTag.cs

示例11: UpdateData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            MemoryStream m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            RecordHeader rh = new RecordHeader(TagCode, 4);
            rh.WriteTo(w);

            w.Write(characterId);
            w.Write(depth);

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:18,代码来源:RemoveObjectTag.cs

示例12: ReadData

 /// <summary>
 /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
 /// </summary>
 public override void ReadData(byte version, BufferedBinaryReader binaryReader)
 {
     RecordHeader rh = new RecordHeader();
     rh.ReadData(binaryReader);
     characterId = binaryReader.ReadUInt16();
     depth = binaryReader.ReadUInt16();
 }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:10,代码来源:RemoveObjectTag.cs

示例13: UpdateData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            MemoryStream m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            RecordHeader rh = new RecordHeader(TagCode, GetSizeOf());
            rh.WriteTo(w);

            w.WriteUBits(0, 4);
            w.WriteUBits(playbackSoundRate, 2);
            w.WriteUBits(playbackSoundSize, 1);
            w.WriteUBits(playbackSoundType, 1);
            w.WriteUBits(streamSoundCompression, 4);
            w.WriteUBits(streamSoundRate, 2);
            w.WriteUBits(streamSoundSize, 1);
            w.WriteUBits(streamSoundType, 1);
            w.Write(streamSoundSampleCount);
            if (streamSoundCompression == 2)
                w.Write(latencySeek);

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:27,代码来源:SoundStreamHeadTag.cs

示例14: ReadData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            binaryReader.ReadUBits(4);
            playbackSoundRate = binaryReader.ReadUBits(2);
            playbackSoundSize = binaryReader.ReadUBits(1);
            playbackSoundType = binaryReader.ReadUBits(1);
            streamSoundCompression = binaryReader.ReadUBits(4);
            streamSoundRate = binaryReader.ReadUBits(2);
            streamSoundSize = binaryReader.ReadUBits(1);
            streamSoundType = binaryReader.ReadUBits(1);

            streamSoundSampleCount = binaryReader.ReadUInt16();
            latencySeek = 0;

            if (streamSoundCompression == 2)
                latencySeek = binaryReader.ReadInt16();
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:23,代码来源:SoundStreamHeadTag.cs

示例15: UpdateData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void UpdateData(byte version)
        {
            if (version < 3)
                return;

            MemoryStream m = new MemoryStream();
            BufferedBinaryWriter w = new BufferedBinaryWriter(m);

            RecordHeader rh = new RecordHeader(TagCode, GetSizeOf(version));
            rh.WriteTo(w);

            if (name != null)
                w.WriteString(name, (uint)name.Length);
            if (version >= 6)
                w.Write((byte)1);

            w.Flush();
            // write to data array
            _data = m.ToArray();
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:23,代码来源:FrameLabelTag.cs


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