Framework > Graphics > Geometries > Graphics Paths 
A graphics path is a sequence of points, that represent a collection of line segments and/or cubic bezier curves. The line and bezier segments inside a single graphics path can form multiple closed and open figures. There is an additional type parameter assigned to each point of the graphics path, that determines whether the point is a point from line segment, from a bezier segment, whether the point closes the current figure etc.
In NOV the graphics path is represented by the NGraphicsPath class. The graphics path is a multipoint geometry object, an as such shares a number of common features with polylines and polygons  see Multipoint Geometries.
Following is a brief overview of the most common operations that you can perform with a graphics path:
The most common way to fill a graphics path with figures is to use its plotter commands. The usage of plotter commands follows these steps:
The following example renders a line and a triangle inside a graphics path:
Plotter Commands 
Copy Code


NGraphicsPath path = new NGraphicsPath(); // draw a simple line (open figure) path.StartFigure(10, 10); path.LineTo(100, 100); // add a triangle (closed figure) path.StartFigure(10, 10); path.LineTo(100, 10); path.LineTo(10, 100); path.CloseFigure(); 
The NGraphicsPath provides a wealth of methods that help you add geometry objects to the path, such as rectangles, ellipses, triangles etc. These methods can be called at any stage of the graphics path construction. Based on type of figure being added to the graphics path, the methods are divided as follows:
The following code sample adds a rectangle and two line segments to a path:
Adding Basic Figures to a Path 
Copy Code


// AddRectangle adds an entiry closed figure path.AddRectangle(new NRectangle(0, 0, 100, 100)); // AddLineSegment sees that the current figure is closed and starts a new one (20, 20). path.AddLineSegment(new NLineSegment(20, 20, 40, 30)); // AddLineSegment sees that the current figure is open and emits a new line to connect with it path.AddLineSegment(new NLineSegment(30, 100, 25, 35)); // At this point the path has one closed rectangle figure, and open open figure that has the following points: // (START:(20,20),LINETO(40,30),LINETO(30,100),LINETO(25,35) 
You can get the count of figures contained inside a graphics via the GetFiguresCount() method. You can get information about the figure at a specific index via the GetFigure method. The following code sample iterates the figures of a path:
Iterate the Figures of a Path 
Copy Code


int count = path.GetFigureCount(); for (int i = 0; i < count; i++) { NGraphicsPathFigure figure = path.GetFigure(i); // determine whether figure is closed. bool isClosed = figure.Closed; // get figure bounds NRectangle figureBounds = path.GetFigureBounds(figure); // get figure path NGraphicsPath figurePath = path.GetFigurePath(figure); } 
A graphics path is said to be flat, if it contains only line segments (i.e. does not contain cubic bezier segments). You can query whether a path is flat via the IsFlat property. The conversion of a nonflat graphics path to a flat one is called flattening and results in a graphics path, in which bezier curves from the original path are approximated with line segments. You can flatten a graphics path via the Flatten method.
You can query whether a point hits the filled area of the path via the Contains method. You can query whether a point hits the stroked outline of a path via the ContainsOnOutline method.