本文整理汇总了C#中SwfDotNet.IO.Tags.RecordHeader类的典型用法代码示例。如果您正苦于以下问题:C# RecordHeader类的具体用法?C# RecordHeader怎么用?C# RecordHeader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RecordHeader类属于SwfDotNet.IO.Tags命名空间,在下文中一共展示了RecordHeader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
int tl = System.Convert.ToInt32(rh.TagLength);
Meta = binaryReader.ReadString();
}
示例2: UpdateData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void UpdateData(byte version)
{
MemoryStream m = new MemoryStream();
BufferedBinaryWriter w = new BufferedBinaryWriter(m);
RecordHeader rh = new RecordHeader(TagCode, GetSizeOf());
rh.WriteTo(w);
if (Meta != null)
w.Write(Meta);
w.Flush();
// write to data array
_data = m.ToArray();
}
示例3: UpdateData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void UpdateData(byte version)
{
if (version < 6)
return;
MemoryStream m = new MemoryStream();
BufferedBinaryWriter w = new BufferedBinaryWriter(m);
RecordHeader rh = new RecordHeader(TagCode, GetSizeOf(), true);
rh.WriteTo(w);
w.Write(this.fontId);
w.Write((byte)this.fontName.Length);
if (fontName != null)
w.WriteString(this.fontName, (uint)this.fontName.Length);
w.WriteUBits(0, 2);
w.WriteBoolean(fontFlagsSmallText);
w.WriteUBits(0, 2);
w.WriteBoolean(fontFlagsItalic);
w.WriteBoolean(fontFlagsBold);
w.WriteBoolean(true);
w.Write(this.languageCode);
if (codeTable != null)
{
IEnumerator glyphs = codeTable.GetEnumerator();
while (glyphs.MoveNext())
w.Write((ushort)glyphs.Current);
}
w.Flush();
// write to data array
_data = m.ToArray();
}
示例4: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
soundId = binaryReader.ReadUInt16();
soundFormat = binaryReader.ReadUBits(4);
soundRate = binaryReader.ReadUBits(2);
soundSize = binaryReader.ReadUBits(1);
soundType = binaryReader.ReadUBits(1);
soundSampleCount = binaryReader.ReadUInt32();
uint size = rh.TagLength - 2 - 1 - 4;
soundData = new byte[size];
for (uint i = 0; i < size; i++)
soundData[i] = binaryReader.ReadByte();
}
示例5: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
characterId = binaryReader.ReadUInt16();
binaryReader.SynchBits();
startBounds = new Rect();
startBounds.ReadData(binaryReader);
binaryReader.SynchBits();
endBounds = new Rect();
endBounds.ReadData(binaryReader);
binaryReader.SynchBits();
offset = binaryReader.ReadUInt32();
morphFillStyles = new MorphFillStyleCollection();
morphFillStyles.ReadData(binaryReader);
morphLineStyles = new MorphLineStyleCollection();
morphLineStyles.ReadData(binaryReader);
ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;
startEdges = new ShapeRecordCollection();
startEdges.ReadData(binaryReader, ShapeType.None);
ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;
endEdges = new ShapeRecordCollection();
endEdges.ReadData(binaryReader, ShapeType.None);
}
示例6: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
int beforePos = (int)binaryReader.BaseStream.Position;
int toReaded = (int)rh.TagLength - 7;
_characterId = binaryReader.ReadUInt16();
_bitmapFormat = binaryReader.ReadByte();
_bitmapWidth = binaryReader.ReadUInt16();
_bitmapHeight = binaryReader.ReadUInt16();
_bitmapColorTableSize = 0;
if (_bitmapFormat == 3)
{
_bitmapColorTableSize = binaryReader.ReadByte();
toReaded--;
}
if (_bitmapFormat == 3)
{
_colorMapData = new ColorMapData();
_colorMapData.ReadData(binaryReader, _bitmapColorTableSize, _bitmapWidth, _bitmapHeight, toReaded);
}
else if (_bitmapFormat == 4 || _bitmapFormat == 5)
{
int imageSize = _bitmapWidth * _bitmapHeight;
int uncompressedSize = imageSize;
if (_bitmapFormat == 4)
uncompressedSize *= 2;
else
uncompressedSize *= 4;
byte[] uncompressed = new byte[uncompressedSize];
byte[] compressed = binaryReader.ReadBytes(toReaded);
Inflater zipInflator = new Inflater();
zipInflator.SetInput(compressed);
zipInflator.Inflate(uncompressed, 0, uncompressedSize);
_bitmapColorData = null;
if (_bitmapFormat == 4)
{
Pix15[] bitmapPixelData = new Pix15[imageSize];
for (int i = 0, j = 0; i < imageSize; i++, j += 2)
{
byte[] data = new byte[2] {uncompressed[j], uncompressed[j+1]};
bitmapPixelData[i] = new Pix15(data);
}
_bitmapColorData = new BitmapColorData(bitmapPixelData);
}
else
{
Pix24[] bitmapPixelData = new Pix24[imageSize];
for (int i = 0, j = 0; i < imageSize; i++, j += 4)
{
byte reserved = uncompressed[j];
byte red = uncompressed[j + 1];
byte green = uncompressed[j + 2];
byte blue = uncompressed[j + 3];
bitmapPixelData[i] = new Pix24(red, green, blue);
}
_bitmapColorData = new BitmapColorData(bitmapPixelData);
}
}
}
示例7: UpdateData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void UpdateData(byte version)
{
if (version < 3)
return;
MemoryStream m = new MemoryStream();
BufferedBinaryWriter w = new BufferedBinaryWriter(m);
RecordHeader rh = new RecordHeader(TagCode, GetSizeOf());
rh.WriteTo(w);
w.Write(this.buttonId);
w.WriteUBits(0, 7);
w.WriteBoolean(trackAsMenu);
w.Write(this.actionOffset);
if (characters != null)
{
IEnumerator butts = characters.GetEnumerator();
while (butts.MoveNext())
{
((ButtonRecord)butts.Current).WriteTo(w, TagCodeEnum.DefineButton2);
w.SynchBits();
}
}
w.Write((byte)0);
if (actions != null)
{
for (int i = 0; i < actions.Count; i++)
{
ButtonCondaction buttCon = actions[i];
if (i == actions.Count - 1)
w.Write((ushort)0);
else
{
int size = buttCon.GetSizeOf();
w.Write((ushort)size);
}
buttCon.WriteTo(w);
}
}
w.Flush();
// write to data array
_data = m.ToArray();
}
示例8: UpdateData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void UpdateData(byte version)
{
if (version < 5)
return;
MemoryStream m = new MemoryStream();
BufferedBinaryWriter w = new BufferedBinaryWriter(m);
RecordHeader rh = new RecordHeader(TagCode, GetSizeOf());
rh.WriteTo(w);
if (exportedCharacters != null)
w.Write((ushort)exportedCharacters.Count);
else
w.Write((ushort)0);
if (exportedCharacters != null)
{
IEnumerator assertEnu = exportedCharacters.GetEnumerator();
while (assertEnu.MoveNext())
{
Assert assert = (Assert)assertEnu.Current;
assert.WriteTo(w);
}
}
w.Flush();
// write to data array
_data = m.ToArray();
}
示例9: UpdateData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void UpdateData(byte version)
{
if (version < 7)
return;
MemoryStream m = new MemoryStream();
BufferedBinaryWriter w = new BufferedBinaryWriter(m);
RecordHeader rh = new RecordHeader(TagCode, 4);
rh.WriteTo(w);
w.Write(recursion);
w.Write(timeout);
w.Flush();
// write to data array
_data = m.ToArray();
}
示例10: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
long initPos = binaryReader.BaseStream.Position;
characterId = binaryReader.ReadUInt16();
depth = binaryReader.ReadUInt16();
matrix = new Matrix();
matrix.ReadData(binaryReader);
long pos = binaryReader.BaseStream.Position - initPos;
if (pos < rh.TagLength)
{
colorTransform = new CXForm();
colorTransform.ReadData(binaryReader);
}
}
示例11: UpdateData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void UpdateData(byte version)
{
MemoryStream m = new MemoryStream();
BufferedBinaryWriter w = new BufferedBinaryWriter(m);
RecordHeader rh = new RecordHeader(TagCode, 4);
rh.WriteTo(w);
w.Write(characterId);
w.Write(depth);
w.Flush();
// write to data array
_data = m.ToArray();
}
示例12: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
characterId = binaryReader.ReadUInt16();
depth = binaryReader.ReadUInt16();
}
示例13: UpdateData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void UpdateData(byte version)
{
MemoryStream m = new MemoryStream();
BufferedBinaryWriter w = new BufferedBinaryWriter(m);
RecordHeader rh = new RecordHeader(TagCode, GetSizeOf());
rh.WriteTo(w);
w.WriteUBits(0, 4);
w.WriteUBits(playbackSoundRate, 2);
w.WriteUBits(playbackSoundSize, 1);
w.WriteUBits(playbackSoundType, 1);
w.WriteUBits(streamSoundCompression, 4);
w.WriteUBits(streamSoundRate, 2);
w.WriteUBits(streamSoundSize, 1);
w.WriteUBits(streamSoundType, 1);
w.Write(streamSoundSampleCount);
if (streamSoundCompression == 2)
w.Write(latencySeek);
w.Flush();
// write to data array
_data = m.ToArray();
}
示例14: ReadData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
binaryReader.ReadUBits(4);
playbackSoundRate = binaryReader.ReadUBits(2);
playbackSoundSize = binaryReader.ReadUBits(1);
playbackSoundType = binaryReader.ReadUBits(1);
streamSoundCompression = binaryReader.ReadUBits(4);
streamSoundRate = binaryReader.ReadUBits(2);
streamSoundSize = binaryReader.ReadUBits(1);
streamSoundType = binaryReader.ReadUBits(1);
streamSoundSampleCount = binaryReader.ReadUInt16();
latencySeek = 0;
if (streamSoundCompression == 2)
latencySeek = binaryReader.ReadInt16();
}
示例15: UpdateData
/// <summary>
/// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
/// </summary>
public override void UpdateData(byte version)
{
if (version < 3)
return;
MemoryStream m = new MemoryStream();
BufferedBinaryWriter w = new BufferedBinaryWriter(m);
RecordHeader rh = new RecordHeader(TagCode, GetSizeOf(version));
rh.WriteTo(w);
if (name != null)
w.WriteString(name, (uint)name.Length);
if (version >= 6)
w.Write((byte)1);
w.Flush();
// write to data array
_data = m.ToArray();
}