private String EndCapToString(Pen pen) { if (pen.EndCap != LineCap.Custom) { return(""); } ArrowStyle style = Hacks.GetLineCap(pen.CustomEndCap); switch (style) { case ArrowStyle.TinyArrow: case ArrowStyle.BigArrow: case ArrowStyle.LittleArrow: case ArrowStyle.LineArrow: case ArrowStyle.HollowArrow: case ArrowStyle.PointyArrow: arrowId++; defs.Add(String.Format("<marker id=\"arrow{1}\" viewBox=\"0 0 10 10\" refX=\"0\" refY=\"5\" stroke-width=\"1\" fill=\"rgb({0})\" orient=\"auto\">\n", ColorToRgb(pen.Color), arrowId) + "<path d=\"M 0 0 L 10 5 L 0 10 L 0 0\" />\n" + "</marker>"); break; case ArrowStyle.None: default: return(""); } return(String.Format(" marker-end=\"url(#arrow{0})\"", arrowId)); }
private static Pen GetArrowStyleSample(Color color, ArrowStyle ars) { Pen pen = new Pen(color, 2); if (ars == ArrowStyle.None) { pen.EndCap = LineCap.Flat; } else { pen.CustomEndCap = Hacks.GetLineCap(ars); } return(pen); }
private static CustomLineCap ArrowStyleToLineCap(ArrowStyle arrowstyle) { return(Hacks.GetLineCap(arrowstyle)); }