public static IEnumerable <EmfPlusPointBase> GetPoints(MetafileReader reader, bool relative, bool compressed, uint count) { var points = new EmfPlusPointBase[count]; for (uint i = 0; i < count; i++) { EmfPlusPointBase point; if (relative) { throw new InvalidOperationException("Don't know how to handle relative points."); } else { if (compressed) { point = new EmfPlusPoint(reader); } else { point = new EmfPlusPointF(reader); } } points[i] = point; } return(points); }
public EmfPlusDrawDriverString(MetafileReader reader) : base(reader) { BrushIdOrColor = reader.ReadUInt32(); OptionsFlags = (DriverStringOptionsFlags)reader.ReadUInt32(); MatrixPresent = reader.ReadBoolean(); GlyphCount = reader.ReadUInt32(); var glyphs = new List <ushort>(); for (int i = 0; i < GlyphCount; i++) { ushort glyph = reader.ReadUInt16(); glyphs.Add(glyph); } Glyphs = glyphs; var positions = new List <EmfPlusPointF>(); for (uint i = 0; i < GlyphCount; i++) { var position = new EmfPlusPointF(reader); positions.Add(position); } Positions = positions; if (MatrixPresent) { Transform = new EmfPlusTransformMatrix(reader); } }