示例#1
0
        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));
        }
示例#2
0
文件: LineDialog.cs 项目: evest/Tree
        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);
        }
示例#3
0
 private static CustomLineCap ArrowStyleToLineCap(ArrowStyle arrowstyle)
 {
     return(Hacks.GetLineCap(arrowstyle));
 }