本文整理汇总了C#中SwfDotNet.IO.Tags.RecordHeader.ReadData方法的典型用法代码示例。如果您正苦于以下问题:C# RecordHeader.ReadData方法的具体用法?C# RecordHeader.ReadData怎么用?C# RecordHeader.ReadData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SwfDotNet.IO.Tags.RecordHeader
的用法示例。
在下文中一共展示了RecordHeader.ReadData方法的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: 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);
streamId = binaryReader.ReadUInt16();
frameNum = binaryReader.ReadUInt16();
if (codecId == 2)
{
video = new H263VideoPacket();
video.ReadData(binaryReader);
}
else if (codecId == 3)
{
video = new ScreenVideoPacket();
video.ReadData(binaryReader);
}
}
示例3: 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);
}
示例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);
}
示例5: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="version">Version.</param>
/// <param name="binaryReader">Binary reader.</param>
public override void ReadData(byte version, BufferedBinaryReader binaryReader)
{
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
ushort count = binaryReader.ReadUInt16();
exportedCharacters.Clear();
if (count > 0)
{
for (int i = 0; i < count; i++)
{
Assert exportedCharacter = new Assert();
exportedCharacter.ReadData(binaryReader);
this.exportedCharacters.Add(exportedCharacter);
}
}
}
示例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);
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);
}
}
示例7: 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--;
}
int imageSize = _bitmapWidth * _bitmapHeight;
if (_bitmapFormat == 3)
{
int uncompressedSize = imageSize + ((_bitmapColorTableSize + 1) * 4);
byte[] uncompressed = new byte[uncompressedSize];
byte[] compressed = binaryReader.ReadBytes(toReaded);
Inflater zipInflator = new Inflater();
zipInflator.SetInput(compressed);
zipInflator.Inflate(uncompressed, 0, uncompressedSize);
_alphaColorMapData = new AlphaColorMapData();
_alphaColorMapData.ColorTableRgb = new RGBA[_bitmapColorTableSize + 1];
int offset = 0;
for (int i = 0; i < _bitmapColorTableSize + 1; i++, offset += 4)
{
byte red = uncompressed[offset];
byte green = uncompressed[offset + 1];
byte blue = uncompressed[offset + 2];
byte alpha = uncompressed[offset + 3];
_alphaColorMapData.ColorTableRgb[i] = new RGBA(red, green, blue, alpha);
}
_alphaColorMapData.ColorMapPixelData = new byte[uncompressedSize - offset];
for (int i = 0; i < uncompressedSize - offset; i++, offset++)
_alphaColorMapData.ColorMapPixelData[i] = uncompressed[offset];
}
else if (_bitmapFormat == 4 || _bitmapFormat == 5)
{
int uncompressedSize = imageSize * 4;
byte[] uncompressed = new byte[uncompressedSize];
byte[] compressed = binaryReader.ReadBytes(toReaded);
Inflater zipInflator = new Inflater();
zipInflator.SetInput(compressed);
zipInflator.Inflate(uncompressed, 0, uncompressedSize);
_alphaBitmapData = new AlphaBitmapData();
_alphaBitmapData.BitmapPixelData = new RGBA[imageSize];
for (int i = 0, j = 0; i < imageSize; i++, j += 4)
{
byte red = uncompressed[j];
byte green = uncompressed[j + 1];
byte blue = uncompressed[j + 2];
byte alpha = uncompressed[j + 3];
_alphaBitmapData.BitmapPixelData[i] = new RGBA(red, green, blue, alpha);
}
}
}
示例8: 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);
fontId = binaryReader.ReadUInt16();
bool fontFlagsHasLayout = binaryReader.ReadBoolean();
fontFlagsShiftJIS = binaryReader.ReadBoolean();
fontFlagsSmallText = binaryReader.ReadBoolean();
fontFlagsANSI = binaryReader.ReadBoolean();
bool fontFlagsWideOffsets = binaryReader.ReadBoolean();
bool fontFlagsWideCodes = binaryReader.ReadBoolean();
fontFlagsItalic = binaryReader.ReadBoolean();
fontFlagsBold = binaryReader.ReadBoolean();
languageCode = (LanguageCode)binaryReader.ReadByte();
byte fontNameLength = binaryReader.ReadByte();
fontName = binaryReader.ReadString(fontNameLength);
ushort numGlyphs = binaryReader.ReadUInt16();
if (numGlyphs > 0)
{
uint[] offsetTable = new uint[numGlyphs];
for (int i = 0; i < numGlyphs; i++)
{
if (fontFlagsWideOffsets)
offsetTable[i] = binaryReader.ReadUInt32();
else
offsetTable[i] = (uint)binaryReader.ReadUInt16();
}
}
uint codeTableOffset = 0;
if (fontFlagsWideOffsets)
codeTableOffset = binaryReader.ReadUInt32();
else
codeTableOffset = (uint)binaryReader.ReadUInt16();
if (numGlyphs > 0)
{
this.glyphShapesTable.IsWideCodes = fontFlagsWideCodes;
this.glyphShapesTable.ReadData(binaryReader, numGlyphs);
}
if (fontFlagsHasLayout)
{
fontAscent = binaryReader.ReadInt16();
fontDescent = binaryReader.ReadInt16();
fontLeading = binaryReader.ReadInt16();
if (numGlyphs > 0)
{
fontAdvanceTable.ReadData(binaryReader, numGlyphs);
fontBoundsTable.ReadData(binaryReader, numGlyphs);
fontKerningTable.ReadData(binaryReader, fontFlagsWideCodes);
}
}
}
示例9: 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);
characterId = binaryReader.ReadUInt16();
int imgLen = Convert.ToInt32(binaryReader.ReadUInt32());
if (imgLen > 0)
{
jpegData = binaryReader.ReadBytes(imgLen);
alphaData = binaryReader.ReadBytes(tl - 6 - imgLen);
}
}
示例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);
fontId = binaryReader.ReadUInt16();
ushort firstOffset = binaryReader.ReadUInt16();
int nGlyhs = System.Convert.ToInt32( Math.Ceiling((double) firstOffset / 2 ) );
offsetTable = new ushort[nGlyhs];
offsetTable[0] = firstOffset;
for (int i = 1; i < nGlyhs; i++)
offsetTable[i] = binaryReader.ReadUInt16();
ShapeWithStyle.NumFillBits = 0;
ShapeWithStyle.NumLineBits = 0;
glyphShapesTable.ReadData(binaryReader, (ushort)nGlyhs);
}
示例11: 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.ReadByte();
int lenght = System.Convert.ToInt32(rh.TagLength - 1);
password = binaryReader.ReadString();
//char[] password = br.ReadChars(lenght);
}
示例12: ReadTag
/// <summary>
/// Read next tag from swf input stream.
/// </summary>
/// <param name="version">Version.</param>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="tagList">Tag list.</param>
/// <returns></returns>
internal static BaseTag ReadTag(byte version, BufferedBinaryReader binaryReader, BaseTagCollection tagList)
{
long posBefore = binaryReader.BaseStream.Position;
RecordHeader rh = new RecordHeader();
rh.ReadData(binaryReader);
int offset = (int)(binaryReader.BaseStream.Position - posBefore);
binaryReader.BaseStream.Position = posBefore;
BaseTag resTag = null;
switch (rh.TagCode)
{
case (int)TagCodeEnum.DefineBits: resTag = new DefineBitsTag(); break;
case (int)TagCodeEnum.DefineBitsJpeg2: resTag = new DefineBitsJpeg2Tag(); break;
case (int)TagCodeEnum.DefineBitsJpeg3: resTag = new DefineBitsJpeg3Tag(); break;
case (int)TagCodeEnum.DefineBitsLossLess: resTag = new DefineBitsLossLessTag(); break;
case (int)TagCodeEnum.DefineBitsLossLess2: resTag = new DefineBitsLossLess2Tag(); break;
case (int)TagCodeEnum.DefineButton: resTag = new DefineButtonTag(); break;
case (int)TagCodeEnum.DefineButton2: resTag = new DefineButton2Tag(); break;
case (int)TagCodeEnum.DefineButtonCxForm: resTag = new DefineButtonCxFormTag(); break;
case (int)TagCodeEnum.DefineButtonSound: resTag = new DefineButtonSoundTag(); break;
case (int)TagCodeEnum.DefineEditText: resTag = new DefineEditTextTag(); break;
case (int)TagCodeEnum.DefineFont: resTag = new DefineFontTag(); break;
case (int)TagCodeEnum.DefineFont2: resTag = new DefineFont2Tag(); break;
case (int)TagCodeEnum.DefineFontInfo: resTag = new DefineFontInfoTag(); break;
case (int)TagCodeEnum.DefineFontInfo2: resTag = new DefineFontInfo2Tag(); break;
case (int)TagCodeEnum.DefineMorphShape: resTag = new DefineMorphShapeTag(); break;
case (int)TagCodeEnum.DefineShape: resTag = new DefineShapeTag(); break;
case (int)TagCodeEnum.DefineShape2: resTag = new DefineShape2Tag(); break;
case (int)TagCodeEnum.DefineShape3: resTag = new DefineShape3Tag(); break;
case (int)TagCodeEnum.DefineSound: resTag = new DefineSoundTag(); break;
case (int)TagCodeEnum.DefineSprite: resTag = new DefineSpriteTag(); break;
case (int)TagCodeEnum.DefineText: resTag = new DefineTextTag(); break;
case (int)TagCodeEnum.DefineText2: resTag = new DefineText2Tag(); break;
case (int)TagCodeEnum.DefineVideoStream: resTag = new DefineVideoStreamTag(); break;
case (int)TagCodeEnum.DoAction: resTag = new DoActionTag(); break;
case (int)TagCodeEnum.EnableDebugger: resTag = new EnableDebuggerTag(); break;
case (int)TagCodeEnum.EnableDebugger2: resTag = new EnableDebugger2Tag(); break;
case (int)TagCodeEnum.End: resTag = new EndTag(); break;
case (int)TagCodeEnum.ExportAssets: resTag = new ExportAssetsTag(); break;
case (int)TagCodeEnum.FrameLabel: resTag = new FrameLabelTag(); break;
case (int)TagCodeEnum.ImportAssets: resTag = new ImportAssetsTag(); break;
case (int)TagCodeEnum.InitAction: resTag = new InitActionTag(); break;
case (int)TagCodeEnum.JpegTable: resTag = new JpegTableTag(); break;
case (int)TagCodeEnum.PlaceObject: resTag = new PlaceObjectTag(); break;
case (int)TagCodeEnum.PlaceObject2: resTag = new PlaceObject2Tag(); break;
case (int)TagCodeEnum.Protect: resTag = new ProtectTag(); break;
case (int)TagCodeEnum.RemoveObject: resTag = new RemoveObjectTag(); break;
case (int)TagCodeEnum.RemoveObject2: resTag = new RemoveObject2Tag(); break;
case (int)TagCodeEnum.ScriptLimit: resTag = new ScriptLimitTag(); break;
case (int)TagCodeEnum.SetBackgroundColor: resTag = new SetBackgroundColorTag(); break;
case (int)TagCodeEnum.SetTabIndex: resTag = new SetTabIndexTag(); break;
case (int)TagCodeEnum.ShowFrame: resTag = new ShowFrameTag(); break;
case (int)TagCodeEnum.SoundStreamBlock: resTag = new SoundStreamBlockTag(); break;
case (int)TagCodeEnum.SoundStreamHead: resTag = new SoundStreamHeadTag(); break;
case (int)TagCodeEnum.SoundStreamHead2: resTag = new SoundStreamHead2Tag(); break;
case (int)TagCodeEnum.StartSound: resTag = new StartSoundTag(); break;
//TODO: Sorenson Codec
case (int)TagCodeEnum.VideoFrame: resTag = ReadVideoFrameTag(binaryReader, tagList); break;
default: resTag = new BaseTag(binaryReader.ReadBytes(System.Convert.ToInt32(rh.TagLength + offset))); break;
}
//Read the data of the current tag
resTag.ReadData(version, binaryReader);
//LOG
long mustRead = rh.TagLength + offset;
if (posBefore + mustRead != binaryReader.BaseStream.Position)
{
binaryReader.BaseStream.Position = posBefore + rh.TagLength + offset;
if (log.IsErrorEnabled)
log.Error(Enum.GetName(TagCodeEnum.DefineBits.GetType(), rh.TagCode) + "....KO");
}
else if (log.IsInfoEnabled)
log.Info(Enum.GetName(TagCodeEnum.DefineBits.GetType(), rh.TagCode) + "....OK (" + mustRead + ")");
return resTag;
}
示例13: 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();
if (rect == null)
rect = new Rect();
rect.ReadData(binaryReader);
if (matrix == null)
matrix = new Matrix();
matrix.ReadData(binaryReader);
TextRecordCollection.GLYPH_BITS = binaryReader.ReadByte();
TextRecordCollection.ADVANCE_BITS = binaryReader.ReadByte();
if (textRecords == null)
textRecords = new TextRecordCollection();
else
textRecords.Clear();
bool endOfRecordsFlag = false;
while (!endOfRecordsFlag)
{
TextRecord textRecord = new TextRecord();
textRecord.ReadData(binaryReader, ref endOfRecordsFlag, (TagCodeEnum)this.TagCode);
if (!endOfRecordsFlag)
textRecords.Add(textRecord);
}
}
示例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);
shapeId = binaryReader.ReadUInt16();
rect.ReadData(binaryReader);
shape.ReadData(binaryReader, this.shapeType);
}
示例15: 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();
}