/// <summary> /// Reads the data. /// </summary> /// <param name="binaryReader">Binary reader.</param> /// <param name="shapeType">Shape type.</param> public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType) { base.SetStartPoint(binaryReader); width = binaryReader.ReadUInt16(); rgb = null; if (shapeType == ShapeType.Shape3) { rgb = new RGBA(); rgb.ReadData(binaryReader); } else if (shapeType == ShapeType.Shape || shapeType == ShapeType.Shape2) { rgb = new RGB(); rgb.ReadData(binaryReader); } base.SetEndPoint(binaryReader); }
/// <summary> /// Reads the data. /// </summary> /// <param name="binaryReader">Binary reader.</param> /// <param name="shapeType">Shape type.</param> public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType) { base.SetStartPoint(binaryReader); ratio = binaryReader.ReadByte(); color = null; if (shapeType == ShapeType.Shape3) { color = new RGBA(); color.ReadData(binaryReader); } else if (shapeType == ShapeType.Shape || shapeType == ShapeType.Shape2) { color = new RGB(); color.ReadData(binaryReader); } base.SetEndPoint(binaryReader); }
/// <summary> /// Reads the data. /// </summary> /// <param name="binaryReader">Binary reader.</param> /// <param name="shapeType">Shape type.</param> public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType) { base.SetStartPoint(binaryReader); fillStyleType = binaryReader.ReadByte(); rgbColor = null; gradientMatrix = null; bitmapId = 0; bitmapMatrix = null; gradient = null; if (fillStyleType == (byte)FillStyleType.SolidFill) { if (shapeType == ShapeType.Shape3) { rgbColor = new RGBA(); rgbColor.ReadData(binaryReader); } else if (shapeType == ShapeType.Shape2 || shapeType == ShapeType.Shape) { rgbColor = new RGB(); rgbColor.ReadData(binaryReader); } } if (fillStyleType == (byte)FillStyleType.RadialGradientFill || fillStyleType == (byte)FillStyleType.LinearGradientFill) { gradientMatrix = new Matrix(); gradientMatrix.ReadData(binaryReader); gradient = new GradientRecordCollection(); gradient.ReadData(binaryReader, shapeType); } if (fillStyleType == (byte)FillStyleType.RepeatingBitmapFill || fillStyleType == (byte)FillStyleType.ClippedBitmapFill || fillStyleType == (byte)FillStyleType.NonSmoothedClippedBitmap || fillStyleType == (byte)FillStyleType.NonSmoothedRepeatingBitmap) { bitmapId = binaryReader.ReadUInt16(); bitmapMatrix = new Matrix(); bitmapMatrix.ReadData(binaryReader); } base.SetEndPoint(binaryReader); }
/// <summary> /// Creates a new <see cref="GradientRecord"/> instance. /// </summary> /// <param name="ratio">Ratio.</param> /// <param name="color">Color.</param> public GradientRecord(byte ratio, RGBColor color) { this.ratio = ratio; this.color = color; }
/// <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); } } }
/// <summary> /// Creates a new <see cref="LineStyle"/> instance. /// </summary> /// <param name="width">Width.</param> /// <param name="rgb">Rgb.</param> public LineStyle(ushort width, RGBColor rgb) { this.width = width; this.rgb = rgb; }
/// <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); } } }