* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
2.1 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | ||||
|---|---|---|---|---|---|---|---|---|
| How to: Fill Open Figures | 03/30/2017 |
|
|
5a36b0e4-f1f4-46c0-a85a-22ae98491950 |
How to: Fill Open Figures
You can fill a path by passing a xref:System.Drawing.Drawing2D.GraphicsPath object to the xref:System.Drawing.Graphics.FillPath%2A method. The xref:System.Drawing.Graphics.FillPath%2A 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 xref:System.Drawing.Graphics.FillPath%2A method fills the path according to the default fill mode, which is xref:System.Drawing.Drawing2D.FillMode.Alternate.
The following illustration shows the output of the example code. Note that the path is filled (according to xref:System.Drawing.Drawing2D.FillMode.Alternate) as if the open figure were closed by a straight line from its ending point to its starting point.
[!code-csharpSystem.Drawing.ConstructingDrawingPaths#11] [!code-vbSystem.Drawing.ConstructingDrawingPaths#11]
Compiling the Code
The preceding example is designed for use with Windows Forms, and it requires xref:System.Windows.Forms.PaintEventArgs e, which is a parameter of the xref:System.Windows.Forms.Control.Paint event handler.
