本文整理汇总了C#中DDW.Swf.SwfWriter.ResetLongTagLength方法的典型用法代码示例。如果您正苦于以下问题:C# SwfWriter.ResetLongTagLength方法的具体用法?C# SwfWriter.ResetLongTagLength怎么用?C# SwfWriter.ResetLongTagLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DDW.Swf.SwfWriter
的用法示例。
在下文中一共展示了SwfWriter.ResetLongTagLength方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例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);
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
示例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);
}
示例8: 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);
}
示例9: ToSwf
public void ToSwf(SwfWriter w)
{
uint start = (uint)w.Position;
w.AppendTagIDAndLength(this.TagType, 0, true);
w.AppendUI16(CharacterID);
Bounds.ToSwf(w);
w.AppendBit(HasText);
w.AppendBit(WordWrap);
w.AppendBit(Multiline);
w.AppendBit(Password);
w.AppendBit(ReadOnly);
w.AppendBit(HasTextColor);
w.AppendBit(HasMaxLength);
w.AppendBit(HasFont);
w.AppendBit(false);// resreved
w.AppendBit(AutoSize);
w.AppendBit(HasLayout);
w.AppendBit(NoSelect);
w.AppendBit(Border);
w.AppendBit(false);// resreved
w.AppendBit(HTML);
w.AppendBit(UseOutlines);
if (HasFont)
{
w.AppendUI16(FontID);
w.AppendUI16(FontHeight);
}
if (HasTextColor)
{
w.AppendByte((byte)TextColor.R);
w.AppendByte((byte)TextColor.G);
w.AppendByte((byte)TextColor.B);
w.AppendByte((byte)TextColor.A);
}
if (HasMaxLength)
{
w.AppendUI16(MaxLength);
}
if (HasLayout)
{
w.AppendByte((byte)Align);
w.AppendUI16(LeftMargin);
w.AppendUI16(RightMargin);
w.AppendUI16(Indent);
w.AppendUI16((uint)Leading);
}
w.AppendString(VariableName);
if (HasText)
{
w.AppendString(InitialText);
}
w.ResetLongTagLength(this.TagType, start, true);
}
示例10: ToSwf
public virtual void ToSwf(SwfWriter w)
{
uint start = (uint)w.Position;
w.AppendTagIDAndLength(this.TagType, 0, true);
w.AppendUI16(this.Character);
w.AppendUI16(this.Depth);
Matrix.ToSwf(w);
if (HasColorTransform)
{
ColorTransform.ToSwf(w, false);
}
w.ResetLongTagLength(this.TagType, start);
}
示例11: ToSwf
public void ToSwf(SwfWriter w)
{
uint start = (uint)w.Position;
w.AppendTagIDAndLength(this.TagType, 0, true);
w.AppendUI16(ButtonId);
w.AppendUI16(ButtonSoundChar0);
ButtonSoundInfo0.ToSwf(w);
w.AppendUI16(ButtonSoundChar1);
ButtonSoundInfo1.ToSwf(w);
w.AppendUI16(ButtonSoundChar2);
ButtonSoundInfo2.ToSwf(w);
w.AppendUI16(ButtonSoundChar3);
ButtonSoundInfo3.ToSwf(w);
w.ResetLongTagLength(this.TagType, start, true);
}
示例12: ToSwf
public override void ToSwf(SwfWriter w)
{
uint start = (uint)w.Position;
w.AppendTagIDAndLength(this.TagType, 0, true);
w.AppendBit(HasClipActions);
w.AppendBit(HasClipDepth);
w.AppendBit(HasName);
w.AppendBit(HasRatio);
w.AppendBit(HasColorTransform);
w.AppendBit(HasMatrix);
w.AppendBit(HasCharacter);
w.AppendBit(Move);
w.AppendBits(0, 5); // reserved
w.AppendBit(PlaceFlagHasCacheAsBitmap);
w.AppendBit(PlaceFlagHasBlendMode);
w.AppendBit(PlaceFlagHasFilterList);
w.AppendUI16(Depth);
if (HasCharacter)
{
w.AppendUI16(Character);
}
if (HasMatrix)
{
Matrix.ToSwf(w);
}
if (HasColorTransform)
{
ColorTransform.ToSwf(w, true);
}
if (HasRatio)
{
w.AppendUI16(Ratio);
}
if (HasName)
{
w.AppendString(Name);
}
if (HasClipDepth)
{
w.AppendUI16(ClipDepth);
}
if (PlaceFlagHasFilterList)
{
w.AppendByte((byte)FilterList.Count);
for (int i = 0; i < FilterList.Count; i++)
{
FilterList[i].ToSwf(w);
}
}
if (PlaceFlagHasBlendMode)
{
w.AppendByte((byte)BlendMode);
}
if (HasClipActions)
{
//todo: ClipActions = new ClipActions();
}
w.ResetLongTagLength(this.TagType, start);
}
示例13: ToSwf
//.........这里部分代码省略.........
}
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;
uint unzippedSize = (this.Width * this.Height) * colorBytes;
byte[] mapData = new byte[unzippedSize];
int index = 0;
for (uint i = 0; i < unzippedSize; i += colorBytes)
{
mapData[i + 0] = this.BitmapData[index].A;
mapData[i + 1] = this.BitmapData[index].R;
mapData[i + 2] = this.BitmapData[index].G;
if (HasAlpha)
{
mapData[i + 3] = this.BitmapData[index].B;
}
index++;
}
byte[] zipped = SwfWriter.ZipBytes(mapData);
if (OrgBitmapData != null)
{
w.AppendBytes(OrgBitmapData);
}
else
{
w.AppendBytes(zipped);
}
}
w.ResetLongTagLength(this.TagType, start, true);
}
示例14: ToSwf
public void ToSwf(SwfWriter w)
{
uint start = (uint)w.Position;
w.AppendTagIDAndLength(this.TagType, 0, true);
w.AppendUI16(CharacterId);
TextBounds.ToSwf(w);
TextMatrix.ToSwf(w);
w.AppendByte((byte)glyphBits); // TODO: gen nbits
w.AppendByte((byte)advanceBits); // TODO: gen nbits
for (int i = 0; i < TextRecords.Count; i++)
{
TextRecords[i].ToSwf(w, glyphBits, advanceBits, tagType >= TagType.DefineText2);
}
w.AppendByte(0); // end
w.ResetLongTagLength(this.TagType, start, true);
}
示例15: 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);
}