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


C# SwfWriter.AppendTagIDAndLength方法代码示例

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


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

示例1: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint len = 3;
            w.AppendTagIDAndLength(this.TagType, len, false);

            w.AppendByte(Color.R);
            w.AppendByte(Color.G);
            w.AppendByte(Color.B);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:9,代码来源:BackgroundColorTag.cs

示例2: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            w.AppendUI16(ButtonId);
            ButtonColorTransform.ToSwf(w);

            w.ResetLongTagLength(this.TagType, start, true);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:10,代码来源:DefineButtonCxform.cs

示例3: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            w.AppendUI16(SampleCount);
            w.AppendBytes(SoundData);

            w.ResetLongTagLength(this.TagType, start);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:10,代码来源:SoundStreamBlockTag.cs

示例4: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true); // rewrite len after tag

            w.AppendUI16(this.ShapeId);
            this.ShapeBounds.ToSwf(w);
            this.Shapes.ToSwf(w, ShapeType.DefineShape3);
            w.Align();

            w.ResetLongTagLength(this.TagType, start, true);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:12,代码来源:DefineShape3Tag.cs

示例5: ToSwf

 public void ToSwf(SwfWriter w)
 {
     if (!isInitTag)
     {
         w.AppendTagIDAndLength(this.TagType, CodeSize, true);
     }
     else
     {
         w.AppendTagIDAndLength(TagType.DoInitAction, CodeSize, true);
     }
     ActionRecords.ToSwf(w);
 }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:12,代码来源:DoActionTag.cs

示例6: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            w.AppendUI16((uint)Exports.Count);
            foreach (uint index in Exports.Keys)
            {
                w.AppendUI16(index);
                w.AppendString(Exports[index]);
            }

            w.ResetLongTagLength(this.TagType, start, true);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:14,代码来源:ExportAssetsTag.cs

示例7: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint len = 12;
            w.AppendTagIDAndLength(this.TagType, len, false);

            w.AppendUI16(TextId);
            w.AppendBits(UseFlashType, 2);
            w.AppendBits(GridFit, 3);
            w.AppendBits(0, 3); // reserved
            w.Align();

            w.AppendFixedNBits(Thickness, 32);
            w.AppendFixedNBits(Sharpness, 32);

            w.AppendByte(0); // reserved
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:16,代码来源:CSMTextSettingsTag.cs

示例8: ToSwf

        public virtual void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            uint len = (uint)Ids.Length;
            w.AppendUI16(len);

            for (int i = 0; i < len; i++)
            {
                w.AppendUI16(Ids[i]);
                w.AppendString(Names[i]);
            }

            w.ResetLongTagLength(this.TagType, start, true);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:16,代码来源:SymbolClassTag.cs

示例9: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            w.AppendUI16(SpriteId);
            w.AppendUI16(FrameCount);

            for (int i = 0; i < ControlTags.Count; i++)
            {
                ControlTags[i].ToSwf(w);
            }

            // note: Flash always writes this as a long tag.
            w.ResetLongTagLength(this.TagType, start, true);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:16,代码来源:DefineSpriteTag.cs

示例10: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            if(JpegTable.Length > 0)
            {
                    w.AppendByte(0xFF);
                    w.AppendByte(0xD8);

                    w.AppendBytes(JpegTable);

                    w.AppendByte(0xFF);
                    w.AppendByte(0xD9);
            }

            w.ResetLongTagLength(this.TagType, start, true);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:18,代码来源:JPEGTables.cs

示例11: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            w.AppendUI16(FontId);
            w.AppendBits(CSMTableHint, 2);
            w.AppendBits(0, 6);
            w.Align();

            DefineFont2_3 font = Fonts[FontId];
            uint glyphCount = font.NumGlyphs;

            for (int i = 0; i < glyphCount; i++)
            {
                ZoneTable[i].ToSwf(w);
            }

            w.ResetLongTagLength(this.TagType, start, true);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:20,代码来源:DefineFontAlignZonesTag.cs

示例12: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            w.AppendUI16(CharacterId);
            w.AppendByte((byte)BitmapFormat);
            w.AppendUI16(Width);
            w.AppendUI16(Height);

            if (BitmapFormat == BitmapFormat.Colormapped8Bit) // 8-bit colormapped image
            {
                w.AppendByte((byte)(ColorCount - 1));

                uint colorBytes = HasAlpha ? (uint)4 : (uint)3;
                uint padWidth = this.Width + (4 - (this.Width % 4));
                uint unzippedSize = (this.ColorCount * colorBytes) + (padWidth * this.Height);

                byte[] mapData = new byte[unzippedSize];

                for (int i = 0; i < this.ColorCount; i++)
                {
                    mapData[i * colorBytes + 0] = ColorTable[i].R;
                    mapData[i * colorBytes + 1] = ColorTable[i].G;
                    mapData[i * colorBytes + 2] = ColorTable[i].B;
                    if (HasAlpha)
                    {
                        mapData[i * colorBytes + 3] = ColorTable[i].A;
                    }
                }

                int index = 0;
                int st = (int)(this.ColorCount * colorBytes);
                for (int i = st; i < unzippedSize; i++)
                {
                    if (((i - st) % padWidth) < this.Width)// exclude padding
                    {
                        mapData[i] = (byte)this.ColorData[index++];
                    }
                    else
                    {
                        mapData[i] = 0;
                    }
                }
                byte[] zipped = SwfWriter.ZipBytes(mapData);
                if(OrgBitmapData != null)
                {
                    w.AppendBytes(OrgBitmapData);
                }
                else
                {
                    w.AppendBytes(zipped);
                }

            }

            else if (BitmapFormat == BitmapFormat.RGB15Bit) // rbg 15
            {
                // todo: find a test file for rgb555
                uint colorBytes = 2;
                uint padWidth = this.Width * colorBytes;
                padWidth += (4 - padWidth) % 4;
                uint unzippedSize = (padWidth * this.Height) * colorBytes;

                byte[] mapData = new byte[unzippedSize];

                int index = 0;
                uint byteCount = padWidth * this.Height;
                for (uint i = 0; i < unzippedSize; i += colorBytes)
                {
                    byte rd = this.BitmapData[index].R;
                    byte gr = this.BitmapData[index].G;
                    byte bl = this.BitmapData[index].B;

                    byte b0 = 0;
                    byte b1 = 0;
                    b0 |= (byte)((rd & 0x7C) << 1);
                    b0 |= (byte)((gr & 0x03) << 6);
                    b1 |= (byte)((gr & 0xE0) >> 2);
                    b1 |= (byte)((bl & 0x1F) << 3);

                    mapData[i + 0] = b0;
                    mapData[i + 1] = b1;

                    index++;
                }
                byte[] zipped = SwfWriter.ZipBytes(mapData);
                if (OrgBitmapData != null)
                {
                    w.AppendBytes(OrgBitmapData);
                }
                else
                {
                    w.AppendBytes(zipped);
                }
            }

            else if (BitmapFormat == BitmapFormat.RGB24Bit) // RGB 24
            {
                uint colorBytes = HasAlpha ? (uint)4 : (uint)3;
//.........这里部分代码省略.........
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:101,代码来源:DefineBitsLosslessTag.cs

示例13: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true); // rewrite len after tag

            w.AppendUI16(this.ShapeId);
            this.ShapeBounds.ToSwf(w);
            this.EdgeBounds.ToSwf(w);

            w.AppendBits(0, 6);
            w.AppendBit(this.UsesNonScalingStrokes);
            w.AppendBit(this.UsesScalingStrokes);
            this.Shapes.ToSwf(w, ShapeType.DefineShape4);
            w.Align();

            w.ResetLongTagLength(this.TagType, start, true);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:17,代码来源:DefineShape4Tag.cs

示例14: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            w.AppendUI16(FontId);

            w.AppendBit(FontFlagsHasLayout);
            w.AppendBit(FontFlagsShiftJIS);
            w.AppendBit(FontFlagsSmallText);
            w.AppendBit(FontFlagsANSI);
            w.AppendBit(FontFlagsWideOffsets);
            w.AppendBit(FontFlagsWideCodes);
            w.AppendBit(FontFlagsItalic);
            w.AppendBit(FontFlagsBold);
            w.Align();

            w.AppendByte((byte)LanguageCode);
            w.AppendByte((byte)(FontName.Length + 1)); // add trailing /0
            w.AppendString(FontName, (uint)FontName.Length);

            w.AppendUI16(NumGlyphs);
            for (int i = 0; i < this.NumGlyphs; i++)
            {
                if (this.FontFlagsWideOffsets)
                {
                    w.AppendUI32(this.OffsetTable[i]);
                }
                else
                {
                    w.AppendUI16(this.OffsetTable[i]);
                }
            }

            if (this.FontFlagsWideOffsets)
            {
                w.AppendUI32(this.CodeTableOffset);
            }
            else
            {
                w.AppendUI16(this.CodeTableOffset);
            }

            for (int i = 0; i < this.NumGlyphs; i++)
            {
                GlyphShapeTable[i].ToSwf(w);
            }

            for (int i = 0; i < this.NumGlyphs; i++)
            {
                w.AppendUI16(this.CodeTable[i]);
            }

            if (this.FontFlagsHasLayout)
            {
                w.AppendInt16(FontAscent);
                w.AppendInt16(FontDescent);
                w.AppendInt16(FontLeading);

                for (int i = 0; i < this.NumGlyphs; i++)
                {
                    w.AppendInt16(this.FontAdvanceTable[i]);
                }

                for (int i = 0; i < this.NumGlyphs; i++)
                {
                    this.FontBoundsTable[i].ToSwf(w);
                }

                w.AppendUI16(this.KerningCount);

                if(this.FontFlagsWideCodes)
                {
                    for (int i = 0; i < this.KerningCount; i++)
                    {
                        w.AppendUI16(this.FontKerningTable[i].FontKerningCode1);
                        w.AppendUI16(this.FontKerningTable[i].FontKerningCode2);
                        w.AppendInt16(this.FontKerningTable[i].FontKerningAdjustment);
                    }
                }
                else
                {
                    for (int i = 0; i < this.KerningCount; i++)
                    {
                        w.AppendByte((byte)this.FontKerningTable[i].FontKerningCode1);
                        w.AppendByte((byte)this.FontKerningTable[i].FontKerningCode2);
                        w.AppendInt16(this.FontKerningTable[i].FontKerningAdjustment);
                    }
                }
            }

            w.ResetLongTagLength(this.TagType, start, true);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:93,代码来源:DefineFont2_3.cs

示例15: ToSwf

        public void ToSwf(SwfWriter w)
        {
            uint start = (uint)w.Position;
            w.AppendTagIDAndLength(this.TagType, 0, true);

            w.AppendBits(0, 4);
            switch (PlaybackSoundRate)
            {
                case 55000:
                    w.AppendBits(0, 2);
                    break;
                case 11000:
                    w.AppendBits(1, 2);
                    break;
                case 22000:
                    w.AppendBits(2, 2);
                    break;
                case 44000:
                    w.AppendBits(3, 2);
                    break;
            }
            w.AppendBit(PlaybackSoundSize == 16u);
            w.AppendBit(IsStereo);
            w.AppendBits((uint)StreamSoundCompression, 4);

            switch (StreamSoundRate)
            {
                case 55000:
                    w.AppendBits(0, 2);
                    break;
                case 11000:
                    w.AppendBits(1, 2);
                    break;
                case 22000:
                    w.AppendBits(2, 2);
                    break;
                case 44000:
                    w.AppendBits(3, 2);
                    break;
            }
            w.AppendBit(StreamSoundSize == 16u);
            w.AppendBit(StreamIsStereo);
            w.Align();

            w.AppendUI16(StreamSoundSampleCount);

            if (StreamSoundCompression == SoundCompressionType.MP3)
            {
                w.AppendUI16(LatencySeek);
            }

            w.ResetLongTagLength(this.TagType, start);
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:53,代码来源:SoundStreamHeadTag.cs


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