private void WriteShape(DrawShape shape, uint pathNBits) { WriteBits(shape.StrokeIndex, strokeNBits); WriteBits(shape.FillIndex, fillNBits); WriteBits(shape.PathIndex, pathNBits); }
private void ParseShapes(List<Shape> shapes) { Shapes = new List<DrawShape>(); Paths = new List<DrawPath>(); foreach (Shape s in shapes) { uint strokeIndex = (s.Stroke == null) ? 0 : (uint)s.Stroke.UserData; uint fillIndex = (s.Fill == null) ? 0 : (uint)s.Fill.UserData; DrawPath path = new DrawPath(new List<IShapeData>(s.ShapeData)); // clones data int pathIndex = Paths.IndexOf(path); if (pathIndex == -1) { Paths.Add(path); pathIndex = Paths.Count - 1; } DrawShape ds = new DrawShape(strokeIndex, fillIndex, (uint)pathIndex); Shapes.Add(ds); } }
private void WriteShape(DrawShape shape, uint pathNBits) { WriteBits(shape.StrokeIndex, strokeNBits); WriteBits(shape.FillIndex, fillNBits); WriteBits(shape.PathIndex, pathNBits); }