示例#1
0
        private void addRandomPolylineButton_Click(object sender, System.EventArgs e)
        {
            NRectangleF bounds = view.Viewport;
            int         count  = (int)pointsCountNumeric.Value;

            NPolylineShape path = new NPolylineShape(base.GetRandomPoints(bounds, count));

            document.ActiveLayer.AddChild(path);

            path.Style = path.ComposeStyle().Clone() as NStyle;
            path.Style.StrokeStyle.Color = Color.DarkCyan;
            path.Style.StartArrowheadStyle.StrokeStyle.Color = Color.DarkCyan;
            path.Style.EndArrowheadStyle.StrokeStyle.Color   = Color.DarkCyan;

            view.Selection.SingleSelect(path);

            view.SmartRefresh();
        }
示例#2
0
        private void CreateSamplePolyline2()
        {
            NPointF[] points = new NPointF[]
            {
                new NPointF(212, 250),
                new NPointF(174, 250),
                new NPointF(174, 169),
                new NPointF(242, 169),
                new NPointF(242, 208),
            };

            NPolylineShape hvPolyline = new NPolylineShape(points);

            document.ActiveLayer.AddChild(hvPolyline);

            hvPolyline.Style = hvPolyline.ComposeStyle().Clone() as NStyle;
            hvPolyline.Style.StrokeStyle.Color = Color.OrangeRed;
            hvPolyline.Style.StartArrowheadStyle.StrokeStyle.Color = Color.OrangeRed;
            hvPolyline.Style.EndArrowheadStyle.StrokeStyle.Color   = Color.OrangeRed;
            hvPolyline.Style.BridgeStyle.Shape = BridgeShape.Sides2;
        }