本文整理汇总了C#中DDW.Swf.SwfWriter类的典型用法代码示例。如果您正苦于以下问题:C# SwfWriter类的具体用法?C# SwfWriter怎么用?C# SwfWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SwfWriter类属于DDW.Swf命名空间,在下文中一共展示了SwfWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToSwf
public void ToSwf(SwfWriter w)
{
w.AppendByte((byte)ActionKind.SetTarget);
w.AppendUI16(Length - 3); // don't incude def byte and len
w.AppendString(TargetName);
}
示例2: 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);
}
示例3: ToSwf
public void ToSwf(SwfWriter w)
{
w.AppendByte((byte)ActionKind.GoToLabel);
w.AppendUI16(Length - 3); // don't incude def byte and len
w.AppendString(Label);
}
示例4: ToSwf
public void ToSwf(SwfWriter w)
{
w.AppendByte((byte)ActionKind.StoreRegister);
w.AppendUI16(Length - 3); // don't incude this part
w.AppendByte((byte)Register);
}
示例5: ToSwf
public void ToSwf(SwfWriter w)
{
// write header
this.Header.ToSwf(w);
for (int i = 0; i < Tags.Count; i++)
{
//if (i == 0x2de)//w.Position >= 0x3cd20)//
//{
// i = i;
//}
if (Tags[i] is PlaceObject2Tag)
{
bool is6Plus = this.Header.Version > 5;
((PlaceObject2Tag)Tags[i]).ToSwf(w, is6Plus);
}
else
{
Tags[i].ToSwf(w);
}
}
if (Header.IsCompressed)
{
w.Zip();
}
uint len = (uint)w.Position;
w.Position = 4;
w.AppendUI32(len);
w.Position = len;
}
示例6: ToSwf
public void ToSwf(SwfWriter w)
{
w.AppendByte((byte)ActionKind.WaitForFrame2);
w.AppendUI16(Length - 3); // don't incude def byte and len
w.AppendByte((byte)SkipCount);
}
示例7: ToSwf
public void ToSwf(SwfWriter w)
{
w.AppendByte((byte)ActionKind.GetURL);
w.AppendUI16(Length - 3);// don't incude this part
w.AppendString(UrlString);
w.AppendString(TargetString);
}
示例8: 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);
}
示例9: ToSwf
public void ToSwf(SwfWriter w, bool isSwf6Plus)
{
w.AppendUI16(0); // reserved
w.AppendBits((uint)ClipEvents, 32);
for (int i = 0; i < ClipActionRecords.Count; i++)
{
ClipActionRecords[i].ToSwf(w, isSwf6Plus);
}
}
示例10: 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);
}
示例11: 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);
}
示例12: 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);
}
示例13: ToSwf
public void ToSwf(SwfWriter w, bool useAlpha)
{
w.AppendUI16(this.Width);
w.AppendByte(Color.R);
w.AppendByte(Color.G);
w.AppendByte(Color.B);
if (useAlpha)
{
w.AppendByte(Color.A);
}
}
示例14: Main
static void Main(string[] args)
{
Console.WriteLine("SWF BITMAP PACKER - swf v8");
Console.WriteLine("");
string fileName = (args.Length < 1) ? "test.swf" : args[0];
if (File.Exists(fileName))
{
fileName = Path.GetFullPath(fileName);
Directory.SetCurrentDirectory(Path.GetDirectoryName(fileName));
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
string name = Path.GetFileNameWithoutExtension(fileName);
SwfReader r = new SwfReader(br.ReadBytes((int)fs.Length));
SwfCompilationUnit scu = new SwfCompilationUnit(r, name);
if (scu.IsValid)
{
SwfToVex s2v = new SwfToVex();
VexObject vo = s2v.Convert(scu);
Dictionary<uint, string> bitmapPaths = s2v.bitmapPaths;
Dictionary<uint, System.Drawing.Rectangle> rectResult = new Dictionary<uint, System.Drawing.Rectangle>();
UnsafeBitmap fullBitmap = BitmapPacker.PackBitmaps(bitmapPaths, rectResult);
foreach (var rect in rectResult)
{
Console.WriteLine("\t" + rect.Value + ",");
}
fullBitmap.Bitmap.Save("fullBitmap.png");
BitmapSwapper bs = new BitmapSwapper();
bs.Convert(scu, fullBitmap, rectResult);
MemoryStream ms = new MemoryStream();
SwfWriter swfWriter = new SwfWriter(ms);
scu.ToSwf(swfWriter);
byte[] swfBytes = swfWriter.ToArray();
FileStream fsw = new FileStream("result.swf", FileMode.Create, FileAccess.Write);
fsw.Write(swfBytes, 0, swfBytes.Length);
fsw.Close();
ms.Close();
}
else
{
Console.WriteLine("Not a valid swf file: " + fileName);
Console.WriteLine("Usage: SwfBitmapPacker <filename>");
}
}
else
{
Console.WriteLine(fileName + " does not exist.");
Console.WriteLine("Usage: SwfBitmapPacker <filename>");
}
}
示例15: ToSwf
public void ToSwf(SwfWriter w, bool useAlpha)
{
w.AppendByte((byte)this.FillType);
w.AppendByte(Color.R);
w.AppendByte(Color.G);
w.AppendByte(Color.B);
if (useAlpha)
{
w.AppendByte(Color.A);
}
}