本文整理汇总了C#中SwfDotNet.IO.Utils.BufferedBinaryReader.SynchBits方法的典型用法代码示例。如果您正苦于以下问题:C# BufferedBinaryReader.SynchBits方法的具体用法?C# BufferedBinaryReader.SynchBits怎么用?C# BufferedBinaryReader.SynchBits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SwfDotNet.IO.Utils.BufferedBinaryReader
的用法示例。
在下文中一共展示了BufferedBinaryReader.SynchBits方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
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);
}
示例2: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public void ReadData(BufferedBinaryReader binaryReader)
{
base.SetStartPoint(binaryReader);
binaryReader.SynchBits();
bool hasScale = binaryReader.ReadBoolean();
if (hasScale)
{
uint nScaleBits = binaryReader.ReadUBits(5);
matrix[0, 0] = binaryReader.ReadFloat(nScaleBits);
matrix[1, 1] = binaryReader.ReadFloat(nScaleBits);
}
bool hasRotate = binaryReader.ReadBoolean();
if (hasRotate)
{
uint nRotateBits = binaryReader.ReadUBits(5);
matrix[1, 0] = binaryReader.ReadFloat(nRotateBits);
matrix[0, 1] = binaryReader.ReadFloat(nRotateBits);
}
uint nTranslateBits = binaryReader.ReadUBits(5);
matrix[0, 2] = (float)binaryReader.ReadSBits(nTranslateBits);
matrix[1, 2] = (float)binaryReader.ReadSBits(nTranslateBits);
binaryReader.SynchBits();
base.SetEndPoint(binaryReader);
}
示例3: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="numGlyphs">Num glyphs.</param>
public void ReadData(BufferedBinaryReader binaryReader, ushort numGlyphs)
{
Clear();
for (int i = 0; i < numGlyphs; i++)
{
binaryReader.SynchBits();
Rect fontBound = new Rect();
fontBound.ReadData(binaryReader);
Add(fontBound);
}
}
示例4: ReadData
/// <summary>
/// Reads the data from a binary file
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
public void ReadData(BufferedBinaryReader binaryReader)
{
this.signature = binaryReader.ReadString(3);
this.version = binaryReader.ReadByte();
if (this.version > MAX_VERSION)
throw new InvalidSwfVersionException(this.version, MAX_VERSION);
this.fileSize = binaryReader.ReadUInt32();
this.rect = new Rect();
this.rect.ReadData(binaryReader);
binaryReader.SynchBits();
this.fps = binaryReader.ReadFloatWord(8, 8);
this.frames = binaryReader.ReadUInt16();
}
示例5: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="shapeType">Shape type.</param>
public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
{
binaryReader.SynchBits();
byte numFillBits = (byte)binaryReader.ReadUBits(4);
byte numLineBits = (byte)binaryReader.ReadUBits(4);
bool readEndShapeRecord = false;
while (!readEndShapeRecord)
{
bool type = binaryReader.ReadBoolean();
byte flags = (byte)binaryReader.ReadUBits(5);
if (type == false)
{
//Non-edge record
if (flags == 0)
{
//EndShapeRecord
readEndShapeRecord = true;
this.Add(new EndShapeRecord());
if (log.IsInfoEnabled)
log.Info("Shape: EndShapeRecord");
}
else
{
//StyleChangerecord
StyleChangeRecord styleChange = new StyleChangeRecord();
styleChange.ReadData(binaryReader, flags, ref numFillBits, ref numLineBits, shapeType);
this.Add(styleChange);
if (log.IsInfoEnabled)
log.Info("Shape: StyleChangeRecord");
}
}
else
{
//Edge record
if ((flags & 0x10) != 0)
{
//StraightedEdgeRecord
StraightEdgeRecord straight = new StraightEdgeRecord();
straight.ReadData(binaryReader, flags);
this.Add(straight);
if (log.IsInfoEnabled)
log.Info("Shape: StraightedEdgeRecord");
}
else
{
//CurvedEdgeRecord
CurvedEdgeRecord curved = new CurvedEdgeRecord();
curved.ReadData(binaryReader, flags);
this.Add(curved);
if (log.IsInfoEnabled)
log.Info("Shape: CurvedEdgeRecord");
}
}
}
}
示例6: ReadData
/// <summary>
/// Reads the data.
/// </summary>
/// <param name="binaryReader">Binary reader.</param>
/// <param name="endOfRecordsFlag">End of records flag.</param>
/// <param name="tagCodeEnum">Tag code enum.</param>
public void ReadData(BufferedBinaryReader binaryReader, ref bool endOfRecordsFlag,
TagCodeEnum tagCodeEnum)
{
binaryReader.SynchBits();
bool textRecordType = binaryReader.ReadBoolean();
binaryReader.ReadUBits(3);
bool styleFlagsHasFont = binaryReader.ReadBoolean();
bool styleFlagsHasColor = binaryReader.ReadBoolean();
bool styleFlagsHasYOffset = binaryReader.ReadBoolean();
bool styleFlagsHasXOffset = binaryReader.ReadBoolean();
if (textRecordType == false)
{
endOfRecordsFlag = true;
return;
}
fontId = 0;
if (styleFlagsHasFont)
fontId = binaryReader.ReadUInt16();
textColor = null;
if (styleFlagsHasColor)
{
if (tagCodeEnum == TagCodeEnum.DefineText2)
{
textColor = new RGBA();
textColor.ReadData(binaryReader);
}
else
{
textColor = new RGB();
textColor.ReadData(binaryReader);
}
}
xOffset = 0;
if (styleFlagsHasXOffset)
xOffset = binaryReader.ReadInt16();
yOffset = 0;
if (styleFlagsHasYOffset)
yOffset = binaryReader.ReadInt16();
textHeight = 0;
if (styleFlagsHasFont)
textHeight = binaryReader.ReadUInt16();
byte glyphCount = binaryReader.ReadByte();
if (glyphCount > 0)
{
if (glyphEntries == null)
glyphEntries = new GlyphEntryCollection();
else
glyphEntries.Clear();
for (int i = 0; i < glyphCount; i++)
{
GlyphEntry glyphEntry = new GlyphEntry();
glyphEntry.ReadData(binaryReader);
glyphEntries.Add(glyphEntry);
}
}
}