예제 #1
0
파일: GraphicsProxy.cs 프로젝트: evest/Tree
        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
        static LineDialog()
        {
            colors = Hacks.GetColorBrushes();

            Array aarrows = Enum.GetValues(typeof(ArrowStyle));

            arrows = aarrows as ArrowStyle[];
            if (arrows == null)
            {
                throw new Exception("Unusual arrow styles");
            }

            Array ashapes = Enum.GetValues(typeof(DecorationShape));

            shapes = ashapes as DecorationShape[];
            if (shapes == null)
            {
                throw new Exception("Got something unexpected from DecorationShape");
            }

            dashstyles = new DashStyle[] { DashStyle.Solid, DashStyle.Dot, DashStyle.Dash,
                                           DashStyle.DashDot, DashStyle.DashDotDot };

            widths = new int[10];
            for (int i = 0; i < widths.Length; i++)
            {
                widths[i] = i + 1;
            }
        }
예제 #3
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);
        }
예제 #4
0
 private static CustomLineCap ArrowStyleToLineCap(ArrowStyle arrowstyle)
 {
     return(Hacks.GetLineCap(arrowstyle));
 }