private void randomCircularArcButton_Click(object sender, System.EventArgs e) { // create shape NPointF start = base.GetRandomPoint(view.Viewport); NPointF end = base.GetRandomPoint(view.Viewport); NEllipticalArcShape shape = null; try { shape = new NEllipticalArcShape(start, end); } catch { return; } // add to active layer document.ActiveLayer.AddChild(shape); document.SmartRefreshAllViews(); }
private void CreateEllipticalArcShape(int row, int col) { NRectangleF cell = GetGridCell(row, col); Color color = GetPredefinedColor(2); // create arc NEllipticalArcShape arc = new NEllipticalArcShape(new NPointF(cell.X, cell.Y), new NPointF(cell.Right, cell.Bottom)); // set stroke style arc.Style.StrokeStyle = new NStrokeStyle(2, color, LinePattern.Dot); // set arrowheads style NArrowheadStyle arrowheadStyle = new NArrowheadStyle( ArrowheadShape.ClosedFork, "", new NSizeL(12, 12), new NColorFillStyle(color), new NStrokeStyle(1, Color.Black)); arc.Style.StartArrowheadStyle = arrowheadStyle; arrowheadStyle = new NArrowheadStyle( ArrowheadShape.DoubleArrow, "", new NSizeL(12, 12), new NColorFillStyle(color), new NStrokeStyle(1, Color.Black)); arc.Style.EndArrowheadStyle = arrowheadStyle; // add to the active layer document.ActiveLayer.AddChild(arc); // add description cell = GetGridCell(row + 1, col); NTextShape text = new NTextShape("Elliptical arc with dots style and ClosedFork and DoubleArrow arrowheads", cell); document.ActiveLayer.AddChild(text); }