--- title: "How to: Fill Open Figures" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "open figures [Windows Forms], filling" - "figures [Windows Forms], filling" ms.assetid: 5a36b0e4-f1f4-46c0-a85a-22ae98491950 --- # How to: Fill Open Figures You can fill a path by passing a object to the method. The method fills the path according to the fill mode (alternate or winding) currently set for the path. If the path has any open figures, the path is filled as if those figures were closed. GDI+ closes a figure by drawing a straight line from its ending point to its starting point. ## Example The following example creates a path that has one open figure (an arc) and one closed figure (an ellipse). The method fills the path according to the default fill mode, which is . The following illustration shows the output of the example code. Note that the path is filled (according to ) as if the open figure were closed by a straight line from its ending point to its starting point. ![Diagram that shows the output of the FillPath method](./media/how-to-fill-open-figures/fill-path-alternate-mode.png) [!code-csharp[System.Drawing.ConstructingDrawingPaths#11](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Drawing.ConstructingDrawingPaths/CS/Class1.cs#11)] [!code-vb[System.Drawing.ConstructingDrawingPaths#11](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.ConstructingDrawingPaths/VB/Class1.vb#11)] ## Compiling the Code The preceding example is designed for use with Windows Forms, and it requires `e`, which is a parameter of the event handler. ## See also - - [Graphics Paths in GDI+](graphics-paths-in-gdi.md)