本文整理汇总了C#中DDW.Swf.SwfWriter.AppendInt16方法的典型用法代码示例。如果您正苦于以下问题:C# SwfWriter.AppendInt16方法的具体用法?C# SwfWriter.AppendInt16怎么用?C# SwfWriter.AppendInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DDW.Swf.SwfWriter
的用法示例。
在下文中一共展示了SwfWriter.AppendInt16方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToSwf
public void ToSwf(SwfWriter w)
{
w.AppendByte((byte)ActionKind.If);
w.AppendUI16(Length - 3); // don't incude def byte and len
w.AppendInt16(BranchOffset);
}
示例2: ToSwf
public void ToSwf(SwfWriter w)
{
w.AppendByte((byte)ActionKind.GotoFrame);
w.AppendUI16(Length - 3);// don't incude this part
w.AppendInt16(Frame);
}
示例3: 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);
}
示例4: 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();
}