public ReadData ( |
||
binaryReader | Binary reader. | |
return | void |
/// <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(); byte fontNameLen = binaryReader.ReadByte(); fontName = binaryReader.ReadString(fontNameLen); binaryReader.ReadUBits(2); //reserved fontFlagsSmallText = binaryReader.ReadBoolean(); binaryReader.ReadUBits(2); //not used fontFlagsItalic = binaryReader.ReadBoolean(); fontFlagsBold = binaryReader.ReadBoolean(); binaryReader.ReadBoolean(); //not used languageCode = binaryReader.ReadByte(); long codeTableLenght = rh.TagLength - 5 - fontNameLen; codeTable = null; codeTable = new ushort[codeTableLenght]; for (int i = 0; i < codeTableLenght / 2; i++) { codeTable[i] = binaryReader.ReadUInt16(); } }
/// <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(); }
/// <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); depth = binaryReader.ReadUInt16(); }
/// <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 lenght = System.Convert.ToInt32(rh.TagLength); password = binaryReader.ReadString(); //char[] password = br.ReadChars(lenght); }
/// <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); rgb = new RGB(); rgb.ReadData(binaryReader); }
/// <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); jpegData = binaryReader.ReadBytes(tl); }
/// <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 lenght = System.Convert.ToInt32(rh.TagLength); actionRecord = binaryReader.ReadBytes(lenght); }
/// <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); }
/// <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); buttonId = binaryReader.ReadUInt16(); buttonColorTransform = new CXForm(); buttonColorTransform.ReadData(binaryReader); }
/// <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(); soundInfo = new SoundInfo(); soundInfo.ReadData(binaryReader); }
/// <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); soundData = new byte[rh.TagLength]; for (uint i = 0; i < rh.TagLength; i++) { soundData[i] = binaryReader.ReadByte(); } }
/// <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(); if (tl - 2 > 0) { jpegData = binaryReader.ReadBytes(tl - 2); } }
/// <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(); numFrames = binaryReader.ReadUInt16(); width = binaryReader.ReadUInt16(); height = binaryReader.ReadUInt16(); binaryReader.ReadUBits(5); videoFlagsDeblocking = binaryReader.ReadUBits(2); videoFlagsSmoothing = binaryReader.ReadBoolean(); codecId = binaryReader.ReadByte(); }
/// <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); int count = binaryReader.ReadUInt16(); for (int i = 0; i < count; i++) { int id = binaryReader.ReadUInt16(); string name = binaryReader.ReadString(Encoding.UTF8); tagsData.Add(id, name); } }
/// <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); uint max = rh.TagLength; if (version >= 6) { max--; } name = binaryReader.ReadString(max); if (version >= 6) { binaryReader.ReadByte(); } }
/// <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); // inner tags long endPos = binaryReader.BaseStream.Position + rh.TagLength; // stuff before inner tags, just read it and dont look any further spriteId = binaryReader.ReadUInt16(); frameCount = binaryReader.ReadUInt16(); while (binaryReader.BaseStream.Position < endPos) { BaseTag b = SwfReader.ReadTag(version, binaryReader, this.tagList); this.tagList.Add(b); } }
/// <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); } } }
/// <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); } } }
/// <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); } }
/// <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); } }
/// <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); buttonId = binaryReader.ReadUInt16(); characters = new ButtonRecordCollection(); bool characterEndFlag = false; while (!characterEndFlag) { byte first = binaryReader.ReadByte(); if (first == 0) { characterEndFlag = true; } else { ButtonRecord buttRecord = new ButtonRecord(); buttRecord.ReadData(binaryReader, first, TagCodeEnum.DefineButton); characters.Add(buttRecord); } } int offset = 2; foreach (ButtonRecord butRec in characters) { offset += butRec.GetSizeOf(); } int lenght = System.Convert.ToInt32(rh.TagLength) - offset - 1; //-1 for the ActionEndFlag actions = binaryReader.ReadBytes(lenght); //Read ActionEndFlag binaryReader.ReadByte(); }
/// <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); }
/// <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(); byte fontNameLen = binaryReader.ReadByte(); fontName = binaryReader.ReadString(fontNameLen); binaryReader.ReadUBits(2); //reserved fontFlagsSmallText = binaryReader.ReadBoolean(); fontFlagsShiftJIS = binaryReader.ReadBoolean(); fontFlagsAINSI = binaryReader.ReadBoolean(); fontFlagsItalic = binaryReader.ReadBoolean(); fontFlagsBold = binaryReader.ReadBoolean(); fontFlagsWildCodes = binaryReader.ReadBoolean(); uint codeTableLenght = rh.TagLength - 4 - fontNameLen; if (!fontFlagsWildCodes) { codeTable = new uint[codeTableLenght]; for (int i = 0; i < codeTableLenght; i++) { codeTable[i] = (uint)binaryReader.ReadByte(); } } else { codeTable = new uint[codeTableLenght / 2]; for (int i = 0; i < codeTableLenght / 2; i++) { codeTable[i] = (uint)binaryReader.ReadUInt16(); } } }
/// <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(); } }
/// <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(); } }
/// <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); }
/// <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); buttonId = binaryReader.ReadUInt16(); buttonSoundChar = binaryReader.ReadUInt16(); buttonSoundInfo = null; if (buttonSoundChar != 0) { buttonSoundInfo = new SoundInfo(); buttonSoundInfo.ReadData(binaryReader); } buttonSoundChar1 = binaryReader.ReadUInt16(); buttonSoundInfo1 = null; if (buttonSoundChar1 != 0) { buttonSoundInfo1 = new SoundInfo(); buttonSoundInfo1.ReadData(binaryReader); } buttonSoundChar2 = binaryReader.ReadUInt16(); buttonSoundInfo2 = null; if (buttonSoundChar2 != 0) { buttonSoundInfo2 = new SoundInfo(); buttonSoundInfo2.ReadData(binaryReader); } buttonSoundChar3 = binaryReader.ReadUInt16(); buttonSoundInfo3 = null; if (buttonSoundChar3 != 0) { buttonSoundInfo3 = new SoundInfo(); buttonSoundInfo3.ReadData(binaryReader); } }
/// <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); } } }
/// <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(); }
/// <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); recursion = binaryReader.ReadUInt16(); timeout = binaryReader.ReadUInt16(); }
/// <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 startPosition = binaryReader.BaseStream.Position; buttonId = binaryReader.ReadUInt16(); binaryReader.ReadUBits(7); //reserved trackAsMenu = binaryReader.ReadBoolean(); long startPos = binaryReader.BaseStream.Position; actionOffset = binaryReader.ReadUInt16(); if (characters == null) characters = new ButtonRecordCollection(); else characters.Clear(); bool characterEndFlag = false; while (!characterEndFlag) { byte first = binaryReader.ReadByte(); if (first == 0) characterEndFlag = true; else { ButtonRecord buttRecord = new ButtonRecord(); buttRecord.ReadData(binaryReader, first, TagCodeEnum.DefineButton2); characters.Add(buttRecord); } } long curr = startPos + actionOffset; actions = new ButtonCondactionCollection(); bool lastCondAction = false; if (actionOffset == 0) lastCondAction = true; while (!lastCondAction) { long readedBytes = binaryReader.BaseStream.Position - startPosition; ushort condActionSize = binaryReader.ReadUInt16(); if (condActionSize == 0) { lastCondAction = true; condActionSize = (ushort)(rh.TagLength - readedBytes); } ButtonCondaction buttCond = new ButtonCondaction(); buttCond.ReadData(binaryReader, condActionSize); actions.Add(buttCond); } }
/// <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); }
/// <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(); numFrames = binaryReader.ReadUInt16(); width = binaryReader.ReadUInt16(); height = binaryReader.ReadUInt16(); binaryReader.ReadUBits(5); videoFlagsDeblocking = binaryReader.ReadUBits(2); videoFlagsSmoothing = binaryReader.ReadBoolean(); codecId = binaryReader.ReadByte(); }
/// <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); spriteId = binaryReader.ReadUInt16(); int lenght = System.Convert.ToInt32(rh.TagLength-2); actionRecord = binaryReader.ReadBytes(lenght); }
/// <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); } }
/// <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); uncompressed = DeflatorWraper.Decompress(compressed); _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); uncompressed = DeflatorWraper.Decompress(compressed); _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); } } }
/// <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); buttonId = binaryReader.ReadUInt16(); characters = new ButtonRecordCollection(); bool characterEndFlag = false; while (!characterEndFlag) { byte first = binaryReader.ReadByte(); if (first == 0) characterEndFlag = true; else { ButtonRecord buttRecord = new ButtonRecord(); buttRecord.ReadData(binaryReader, first, TagCodeEnum.DefineButton); characters.Add(buttRecord); } } int offset = 2; foreach (ButtonRecord butRec in characters) offset += butRec.GetSizeOf(); int lenght = System.Convert.ToInt32(rh.TagLength) - offset - 1; //-1 for the ActionEndFlag actions = binaryReader.ReadBytes(lenght); //Read ActionEndFlag binaryReader.ReadByte(); }
/// <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(); rect = new Rect(); rect.ReadData(binaryReader); BitArray ba = BitParser.GetBitValues(new byte[1]{ binaryReader.ReadByte() }); bool hasText = ba.Get(0); //binaryReader.ReadBoolean(); wordWrap = ba.Get(1); //binaryReader.ReadBoolean(); multiline = ba.Get(2); //binaryReader.ReadBoolean(); password = ba.Get(3); //binaryReader.ReadBoolean(); readOnly = ba.Get(4); //binaryReader.ReadBoolean(); bool hasTextColor = ba.Get(5); //binaryReader.ReadBoolean(); bool hasMaxLength = ba.Get(6); //binaryReader.ReadBoolean(); bool hasFont = ba.Get(7); //binaryReader.ReadBoolean(); //binaryReader.SynchBits(); ba = BitParser.GetBitValues(new byte[1]{ binaryReader.ReadByte() }); //binaryReader.ReadBoolean(); //Reserved autoSize = ba.Get(1); //binaryReader.ReadBoolean(); bool hasLayout = ba.Get(2); //binaryReader.ReadBoolean(); noSelect = ba.Get(3); //binaryReader.ReadBoolean(); border = ba.Get(4); //binaryReader.ReadBoolean(); //binaryReader.ReadBoolean(); //Reserved html = ba.Get(6); //binaryReader.ReadBoolean(); usedOutlines = ba.Get(7); //binaryReader.ReadBoolean(); if (hasFont) { fontId = binaryReader.ReadUInt16(); fontHeight = binaryReader.ReadUInt16(); } if (hasTextColor) { textColor = new RGBA(); textColor.ReadData(binaryReader); } if (hasMaxLength) maxLenght = binaryReader.ReadUInt16(); if (hasLayout) { align = binaryReader.ReadByte(); leftMargin = binaryReader.ReadUInt16(); rightMargin = binaryReader.ReadUInt16(); indent = binaryReader.ReadUInt16(); leading = binaryReader.ReadUInt16(); } variableName = binaryReader.ReadString(); if (hasText) initialText = binaryReader.ReadString(); }
/// <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); }
/// <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); } } }
/// <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); buttonId = binaryReader.ReadUInt16(); buttonColorTransform = new CXForm(); buttonColorTransform.ReadData(binaryReader); }
/// <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(); byte fontNameLen = binaryReader.ReadByte(); fontName = binaryReader.ReadString(fontNameLen); binaryReader.ReadUBits(2); //reserved fontFlagsSmallText = binaryReader.ReadBoolean(); fontFlagsShiftJIS = binaryReader.ReadBoolean(); fontFlagsAINSI = binaryReader.ReadBoolean(); fontFlagsItalic = binaryReader.ReadBoolean(); fontFlagsBold = binaryReader.ReadBoolean(); fontFlagsWildCodes = binaryReader.ReadBoolean(); uint codeTableLenght = rh.TagLength - 4 - fontNameLen; if (!fontFlagsWildCodes) { codeTable = new uint[codeTableLenght]; for (int i = 0; i < codeTableLenght; i++) codeTable[i] = (uint)binaryReader.ReadByte(); } else { codeTable = new uint[codeTableLenght / 2]; for (int i = 0; i < codeTableLenght / 2; i++) codeTable[i] = (uint)binaryReader.ReadUInt16(); } }
/// <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); }
/// <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; }
/// <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); buttonId = binaryReader.ReadUInt16(); buttonSoundChar = binaryReader.ReadUInt16(); buttonSoundInfo = null; if (buttonSoundChar != 0) { buttonSoundInfo = new SoundInfo(); buttonSoundInfo.ReadData(binaryReader); } buttonSoundChar1 = binaryReader.ReadUInt16(); buttonSoundInfo1 = null; if (buttonSoundChar1 != 0) { buttonSoundInfo1 = new SoundInfo(); buttonSoundInfo1.ReadData(binaryReader); } buttonSoundChar2 = binaryReader.ReadUInt16(); buttonSoundInfo2 = null; if (buttonSoundChar2 != 0) { buttonSoundInfo2 = new SoundInfo(); buttonSoundInfo2.ReadData(binaryReader); } buttonSoundChar3 = binaryReader.ReadUInt16(); buttonSoundInfo3 = null; if (buttonSoundChar3 != 0) { buttonSoundInfo3 = new SoundInfo(); buttonSoundInfo3.ReadData(binaryReader); } }
/// <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(); soundInfo = new SoundInfo(); soundInfo.ReadData(binaryReader); }
/// <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); } } }
/// <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(); byte fontNameLen = binaryReader.ReadByte(); fontName = binaryReader.ReadString(fontNameLen); binaryReader.ReadUBits(2); //reserved fontFlagsSmallText = binaryReader.ReadBoolean(); binaryReader.ReadUBits(2); //not used fontFlagsItalic = binaryReader.ReadBoolean(); fontFlagsBold = binaryReader.ReadBoolean(); binaryReader.ReadBoolean(); //not used languageCode = binaryReader.ReadByte(); long codeTableLenght = rh.TagLength - 5 - fontNameLen; codeTable = null; codeTable = new ushort[codeTableLenght]; for (int i = 0; i < codeTableLenght / 2; i++) codeTable[i] = binaryReader.ReadUInt16(); }
/// <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); } }
/// <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); uint max = rh.TagLength; if (version >= 6) max--; name = binaryReader.ReadString(max); if (version >= 6) binaryReader.ReadByte(); }
/// <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); } } }
/// <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(); }
/// <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); }
/// <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); } }
/// <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); }
/// <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(); }
/// <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 startPosition = binaryReader.BaseStream.Position; buttonId = binaryReader.ReadUInt16(); binaryReader.ReadUBits(7); //reserved trackAsMenu = binaryReader.ReadBoolean(); long startPos = binaryReader.BaseStream.Position; actionOffset = binaryReader.ReadUInt16(); if (characters == null) { characters = new ButtonRecordCollection(); } else { characters.Clear(); } bool characterEndFlag = false; while (!characterEndFlag) { byte first = binaryReader.ReadByte(); if (first == 0) { characterEndFlag = true; } else { ButtonRecord buttRecord = new ButtonRecord(); buttRecord.ReadData(binaryReader, first, TagCodeEnum.DefineButton2); characters.Add(buttRecord); } } long curr = startPos + actionOffset; actions = new ButtonCondactionCollection(); bool lastCondAction = false; if (actionOffset == 0) { lastCondAction = true; } while (!lastCondAction) { long readedBytes = binaryReader.BaseStream.Position - startPosition; ushort condActionSize = binaryReader.ReadUInt16(); if (condActionSize == 0) { lastCondAction = true; condActionSize = (ushort)(rh.TagLength - readedBytes); } ButtonCondaction buttCond = new ButtonCondaction(); buttCond.ReadData(binaryReader, condActionSize); actions.Add(buttCond); } }
/// <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(); rect = new Rect(); rect.ReadData(binaryReader); BitArray ba = BitParser.GetBitValues(new byte[1] { binaryReader.ReadByte() }); bool hasText = ba.Get(0); //binaryReader.ReadBoolean(); wordWrap = ba.Get(1); //binaryReader.ReadBoolean(); multiline = ba.Get(2); //binaryReader.ReadBoolean(); password = ba.Get(3); //binaryReader.ReadBoolean(); readOnly = ba.Get(4); //binaryReader.ReadBoolean(); bool hasTextColor = ba.Get(5); //binaryReader.ReadBoolean(); bool hasMaxLength = ba.Get(6); //binaryReader.ReadBoolean(); bool hasFont = ba.Get(7); //binaryReader.ReadBoolean(); //binaryReader.SynchBits(); ba = BitParser.GetBitValues(new byte[1] { binaryReader.ReadByte() }); //binaryReader.ReadBoolean(); //Reserved autoSize = ba.Get(1); //binaryReader.ReadBoolean(); bool hasLayout = ba.Get(2); //binaryReader.ReadBoolean(); noSelect = ba.Get(3); //binaryReader.ReadBoolean(); border = ba.Get(4); //binaryReader.ReadBoolean(); //binaryReader.ReadBoolean(); //Reserved html = ba.Get(6); //binaryReader.ReadBoolean(); usedOutlines = ba.Get(7); //binaryReader.ReadBoolean(); if (hasFont) { fontId = binaryReader.ReadUInt16(); fontHeight = binaryReader.ReadUInt16(); } if (hasTextColor) { textColor = new RGBA(); textColor.ReadData(binaryReader); } if (hasMaxLength) { maxLenght = binaryReader.ReadUInt16(); } if (hasLayout) { align = binaryReader.ReadByte(); leftMargin = binaryReader.ReadUInt16(); rightMargin = binaryReader.ReadUInt16(); indent = binaryReader.ReadUInt16(); leading = binaryReader.ReadUInt16(); } variableName = binaryReader.ReadString(); if (hasText) { initialText = binaryReader.ReadString(); } }
/// <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); } }
/// <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); bool placeFlagHasClipActions = binaryReader.ReadBoolean(); bool placeFlagHasClipDepth = binaryReader.ReadBoolean(); bool placeFlagHasName = binaryReader.ReadBoolean(); bool placeFlagHasRatio = binaryReader.ReadBoolean(); bool placeFlagHasColorTransform = binaryReader.ReadBoolean(); bool placeFlagHasMatrix = binaryReader.ReadBoolean(); bool placeFlagHasCharacter = binaryReader.ReadBoolean(); placeFlagMove = binaryReader.ReadBoolean(); depth = binaryReader.ReadUInt16(); characterId = 0; if (placeFlagHasCharacter) { characterId = binaryReader.ReadUInt16(); } matrix = null; if (placeFlagHasMatrix) { matrix = new Matrix(); matrix.ReadData(binaryReader); } colorTransform = null; if (placeFlagHasColorTransform) { colorTransform = new CXFormWithAlphaData(); colorTransform.ReadData(binaryReader); } ratio = 0; if (placeFlagHasRatio) { ratio = binaryReader.ReadUInt16() / 65535.0f; } name = null; if (placeFlagHasName) { name = binaryReader.ReadString(); } clipDepth = 0; if (placeFlagHasClipDepth) { clipDepth = binaryReader.ReadUInt16(); } // get bytecode actions clipActions = null; if (placeFlagHasClipActions) { // different behaviour for Flash 6+ actionHead = (version >= 6) ? binaryReader.ReadBytes(6) : binaryReader.ReadBytes(4); // read clip action records to list ArrayList clpAc = new ArrayList(); //ClipActionRec a = null; bool res = true; do { ClipActionRec action = new ClipActionRec(); res = action.ReadData(binaryReader, version); if (res) { clpAc.Add(action); } }while (res); // copy list to array clipActions = new ClipActionRec[clpAc.Count]; clpAc.CopyTo(clipActions, 0); } }