private void randomEllipticalArcButton_Click(object sender, System.EventArgs e) { // create shape NPointF start = base.GetRandomPoint(view.Viewport); NPointF end = base.GetRandomPoint(view.Viewport); NPointF control = base.GetRandomPoint(view.Viewport); NCircularArcShape shape = null; try { shape = new NCircularArcShape(start, end, control); } catch { return; } // add to active layer document.ActiveLayer.AddChild(shape); document.SmartRefreshAllViews(); }
private void CreateCircularArcShape(int row, int col) { NRectangleF cell = GetGridCell(row, col); Color color = GetPredefinedColor(1); // create circular arc NCircularArcShape arc = new NCircularArcShape(new NPointF(cell.X, cell.Y), new NPointF(cell.Right, 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("Circular arc with dots style and ClosedFork and DoubleArrow arrowheads", cell); document.ActiveLayer.AddChild(text); }