public DefineShape3Tag(SwfReader r) { this.ShapeId = r.GetUI16(); this.ShapeBounds = new Rect(r); this.Shapes = new ShapeWithStyle(r, ShapeType.DefineShape3); r.Align(); }
public DefineShape4Tag(SwfReader r) { this.ShapeId = r.GetUI16(); this.ShapeBounds = new Rect(r); this.EdgeBounds = new Rect(r); r.SkipBits(6); this.UsesNonScalingStrokes = r.GetBit(); this.UsesScalingStrokes = r.GetBit(); this.Shapes = new ShapeWithStyle(r, ShapeType.DefineShape4); r.Align(); }
public DefineTextTag(SwfReader r, bool useAlpha) { if (useAlpha) { tagType = TagType.DefineText2; } CharacterId = r.GetUI16(); TextBounds = new Rect(r); TextMatrix = new Matrix(r); glyphBits = (uint)r.GetByte(); advanceBits = (uint)r.GetByte(); while (r.PeekByte() != 0x00) { TextRecords.Add(new TextRecord(r, glyphBits, advanceBits, useAlpha)); } byte end = r.GetByte(); }
public SwfHeader(SwfReader r) { this.Signature0 = r.GetByte(); if (this.Signature0 == 'C') { this.IsCompressed = true; r.DecompressSwf(); } else { this.IsCompressed = false; } this.Signature1 = r.GetByte(); this.Signature2 = r.GetByte(); this.IsSwf = (Signature2 == 'S') && (Signature1 == 'W') && ((Signature0 == 'C') || (Signature0 == 'F')); if (IsSwf) { this.Version = r.GetByte(); this.FileLength = r.GetUI32(); this.FrameSize = new Rect(r); UInt16 frate = r.GetUI16(); this.FrameRate = (frate >> 8) + ((frate & 0xFF) / 0xFF); this.FrameCount = r.GetUI16(); } else { this.Version = 0; this.FileLength = 0; this.FrameSize = new Rect(0,0,0,0); this.FrameRate = 0; this.FrameCount = 0; } }
public DefineEditTextTag(SwfReader r) { CharacterID = r.GetUI16(); Bounds = new Rect(r); HasText = r.GetBit(); WordWrap = r.GetBit(); Multiline = r.GetBit(); Password = r.GetBit(); ReadOnly = r.GetBit(); HasTextColor = r.GetBit(); HasMaxLength = r.GetBit(); HasFont = r.GetBit(); r.GetBit();// resreved AutoSize = r.GetBit(); HasLayout = r.GetBit(); NoSelect = r.GetBit(); Border = r.GetBit(); r.GetBit();// resreved HTML = r.GetBit(); UseOutlines = r.GetBit(); if (HasFont) { FontID = r.GetUI16(); FontHeight = r.GetUI16(); } if (HasTextColor) { TextColor = new RGBA(r.GetByte(), r.GetByte(), r.GetByte(), r.GetByte()); } if (HasMaxLength) { MaxLength = r.GetUI16(); } if (HasLayout) { Align = (uint)r.GetByte(); LeftMargin = r.GetUI16(); RightMargin = r.GetUI16(); Indent = r.GetUI16(); Leading = r.GetInt16(); } VariableName = r.GetString(); if (HasText) { InitialText = r.GetString(); } }
private Rectangle ParseRect(Rect tag) { return new Rectangle( tag.XMin / twips, tag.YMin / twips, tag.XMax / twips - tag.XMin / twips, tag.YMax / twips - tag.YMin / twips); }