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


C# SwfWriter.Align方法代码示例

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


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

示例1: ToSwf

        public void ToSwf(SwfWriter w)
        {
            w.Align();

            uint bits = SwfWriter.MinimumBits(this.XMax, this.XMin, this.YMax, this.YMin);

            w.AppendBits((uint)bits, 5);
            w.AppendBits((uint)(this.XMin), bits);
            w.AppendBits((uint)(this.XMax), bits);
            w.AppendBits((uint)(this.YMin), bits);
            w.AppendBits((uint)(this.YMax), bits);

            w.Align();
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:14,代码来源:Rect.cs

示例2: 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

示例3: ToSwf

        public void ToSwf(SwfWriter w)
        {
            w.AppendByte((byte)NumZoneData);

            w.AppendFixedNBits(AlignmentCoordinate1, 16);
            w.AppendFixedNBits(Range1, 16);
            w.AppendFixedNBits(AlignmentCoordinate2, 16);
            w.AppendFixedNBits(Range2, 16);

            w.AppendBits(0, 6); // reserved
            w.AppendBit(ZoneMaskX);
            w.AppendBit(ZoneMaskY);

            w.Align();
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:15,代码来源:ZoneRecord.cs

示例4: 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

示例5: ToSwf

        public void ToSwf(SwfWriter w, ref uint fillBits, ref uint lineBits, ShapeType shapeType)
        {
            // TypeFlag				UB[1]	Non-edge record flag. Always 0.
            // StateNewStyles		UB[1]	New styles flag. Used by DefineShape2 and DefineShape3 only.
            // StateLineStyle		UB[1]	Line style change flag.
            // StateFillStyle1		UB[1]	Fill style 1 change flag.
            // StateFillStyle0		UB[1]	Fill style 0 change flag.
            // StateMoveTo			UB[1]	Move to flag.

            if (shapeType == ShapeType.Glyph)
            {
                w.AppendBit(false);
                w.AppendBit(false);//this.HasNewStyles);

                w.AppendBit(false);//HasLineStyle);
                w.AppendBit(false);//HasFillStyle1);
                w.AppendBit(HasFillStyle0);
                w.AppendBit(HasMove);//HasMove);

                if (HasMove)
                {
                    // not relative moves
                    uint bits = SwfWriter.MinimumBits(this.MoveDeltaX, this.MoveDeltaY);
                    w.AppendBits(bits, 5);
                    w.AppendSignedNBits(this.MoveDeltaX, bits);
                    w.AppendSignedNBits(this.MoveDeltaY, bits);
                }

                if (HasFillStyle0)
                {
                    w.AppendBits(this.FillStyle0, fillBits);
                }
            }
            else
            {
                w.AppendBit(false);
                w.AppendBit(this.HasNewStyles);

                w.AppendBit(HasLineStyle);
                w.AppendBit(HasFillStyle1);
                w.AppendBit(HasFillStyle0);
                w.AppendBit(HasMove);

                if (HasMove)
                {
                    uint bits = SwfWriter.MinimumBits(this.MoveDeltaX, this.MoveDeltaY);
                    w.AppendBits(bits, 5);
                    w.AppendSignedNBits(this.MoveDeltaX, bits);
                    w.AppendSignedNBits(this.MoveDeltaY, bits);
                }

                if (HasFillStyle0)
                {
                    w.AppendBits(this.FillStyle0, fillBits);
                }

                if (HasFillStyle1)
                {
                    w.AppendBits(this.FillStyle1, fillBits);
                }

                if (HasLineStyle)
                {
                    w.AppendBits(this.LineStyle, lineBits);
                }

                if (HasNewStyles)
                {
                    w.Align();
                    FillStyles.ToSwf(w, shapeType);
                    LineStyles.ToSwf(w, shapeType);

                    fillBits = SwfWriter.MinimumBits((uint)FillStyles.FillStyles.Count);
                    lineBits = SwfWriter.MinimumBits((uint)LineStyles.LineStyles.Count); ;

                    w.AppendBits(fillBits, 4);
                    w.AppendBits(lineBits, 4);
                }
            }
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:80,代码来源:StyleChangedRecord.cs

示例6: ToSwf

        public void ToSwf(SwfWriter w)
        {
            w.Align();
            w.AppendBits(fillBits, 4); // always 1
            w.AppendBits(lineBits, 4); // always 0

            for (int i = 0; i < ShapeRecords.Count; i++)
            {
                ShapeRecords[i].ToSwf(w, ref fillBits, ref lineBits, ShapeType.Glyph);
            }
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:11,代码来源:Shape.cs

示例7: 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

示例8: ToSwf

        public void ToSwf(SwfWriter w)
        {
            w.AppendByte((byte)ActionKind.GetURL2);
            w.AppendUI16(Length - 3); // don't incude def byte and len

            w.AppendBits((uint)SendVarsMethod, 2);
            w.AppendBits(0, 4);
            w.AppendBit(TargetIsSprite);
            w.AppendBit(LoadVariables);
            w.Align();
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:11,代码来源:GetURL2.cs

示例9: ToSwf

        public void ToSwf(SwfWriter w, uint glyphBits, uint advanceBits, bool hasAlpha)
        {
            w.AppendBit(TextRecordType);
            w.AppendBits(StyleFlagsReserved, 3);
            w.AppendBit(StyleFlagsHasFont);
            w.AppendBit(StyleFlagsHasColor);
            w.AppendBit(StyleFlagsHasYOffset);
            w.AppendBit(StyleFlagsHasXOffset);
            w.Align();

            if (StyleFlagsHasFont)
            {
                w.AppendUI16(FontID);
            }
            if (StyleFlagsHasColor)
            {
                w.AppendByte(TextColor.R);
                w.AppendByte(TextColor.G);
                w.AppendByte(TextColor.B);
                if (hasAlpha)
                {
                    w.AppendByte(TextColor.A);
                }
            }
            if (StyleFlagsHasXOffset)
            {
                w.AppendInt16(XOffset);
            }
            if (StyleFlagsHasYOffset)
            {
                w.AppendInt16(YOffset);
            }
            if (StyleFlagsHasFont)
            {
                w.AppendUI16(TextHeight);
            }

            w.AppendByte((byte)GlyphEntries.Length);

            for (int i = 0; i < GlyphEntries.Length; i++)
            {
                w.AppendBits(GlyphEntries[i].GlyphIndex, glyphBits);
                w.AppendSignedNBits(GlyphEntries[i].GlyphAdvance, advanceBits);
            }
            w.Align();
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:46,代码来源:TextRecord.cs

示例10: ToSwf

        public void ToSwf(SwfWriter w)
        {
            w.AppendBits(0, 2); // reserved
            w.AppendBit(IsSyncStop);
            w.AppendBit(IsSyncNoMultiple);
            w.AppendBit(HasEnvelope);
            w.AppendBit(HasLoops);
            w.AppendBit(HasOutPoint);
            w.Align();

            if (HasInPoint)
            {
                w.AppendUI32(InPoint);
            }
            if (HasOutPoint)
            {
                w.AppendUI32(OutPoint);
            }
            if (HasLoops)
            {
                w.AppendUI16(LoopCount);
            }
            if (HasEnvelope)
            {
                w.AppendByte((byte)LoopCount);
                uint count = (uint)EnvelopeRecords.Length;
                for (int i = 0; i < EnvelopeRecords.Length; i++)
                {
                    w.AppendUI32(EnvelopeRecords[i].Pos44);
                    w.AppendUI16(EnvelopeRecords[i].LeftLevel);
                    w.AppendUI16(EnvelopeRecords[i].RightLevel);
                }
            }
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:34,代码来源:SoundInfo.cs

示例11: ToSwf

        public void ToSwf(SwfWriter w, ShapeType shapeType)
        {
            FillStyles.ToSwf(w, shapeType);
            LineStyles.ToSwf(w, shapeType);

            w.Align();
            uint fillBits = SwfWriter.MinimumBits((uint)FillStyles.FillStyles.Count);
            uint lineBits = SwfWriter.MinimumBits((uint)LineStyles.LineStyles.Count);
            w.AppendBits(fillBits, 4);
            w.AppendBits(lineBits, 4);
            w.Align();

            for (int i = 0; i < ShapeRecords.Count; i++)
            {
                ShapeRecords[i].ToSwf(w, ref fillBits, ref lineBits, shapeType);
            }
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:17,代码来源:ShapeWithStyle.cs

示例12: ToSwf

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

            w.AppendUI16(SoundId);

            w.AppendBits((uint)SoundFormat, 4);
            switch (SoundRate)
            {
                case 5512:
                    w.AppendBits(0, 2);
                    break;
                case 11025:
                    w.AppendBits(1, 2);
                    break;
                case 22050:
                    w.AppendBits(2, 2);
                    break;
                case 44100:
                    w.AppendBits(3, 2);
                    break;
            }
            w.AppendBit(SoundSize == 16U);
            w.AppendBit(IsStereo);
            w.Align();

            w.AppendUI32(SoundSampleCount);
            w.AppendBytes(SoundData);

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

示例13: ToSwf

        public void ToSwf(SwfWriter w)
        {
            w.AppendByte((byte)ActionKind.GotoFrame2);
            w.AppendUI16(Length - 3); // don't incude def byte and len

            w.AppendBits(0, 6);
            w.AppendBit(SceneBiasFlag);
            w.AppendBit(PlayFlag);
            w.Align();
            if (SceneBiasFlag)
            {
                w.AppendUI16(SceneBias);
            }
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:14,代码来源:GotoFrame2.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)
        {
            bool scale = (this.ScaleX != 1) || (this.ScaleY != 1);
            w.AppendBit(scale);
            if (scale)
            {
                uint bits = SwfWriter.MinimumBits((int)(this.ScaleX * 0x10000), (int)(this.ScaleY * 0x10000));
                w.AppendBits(bits, 5);
                w.AppendFixedNBits(this.ScaleX, bits);
                w.AppendFixedNBits(this.ScaleY, bits);
            }

            bool rotate = (this.Rotate0 != 0) || (this.Rotate1 != 0);
            w.AppendBit(rotate);
            if (rotate)
            {
                uint bits = SwfWriter.MinimumBits((int)(this.Rotate0 * 0x10000), (int)(this.Rotate1 * 0x10000));
                w.AppendBits(bits, 5);
                w.AppendFixedNBits(this.Rotate0, bits);
                w.AppendFixedNBits(this.Rotate1, bits);
            }

            // translate
            uint minbits = 0;
            if (this.TranslateX != 0 || this.TranslateY != 0)
            {
                minbits = SwfWriter.MinimumBits((int)this.TranslateX, (int)this.TranslateY);
            }
            w.AppendBits(minbits, 5);
            w.AppendBits((uint)(this.TranslateX), minbits);
            w.AppendBits((uint)(this.TranslateY), minbits);

            w.Align();
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:34,代码来源:Matrix.cs


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