---
title: "GdiGraphics..::.DrawPie Method (Pen, Int32, Int32, Int32, Int32, Int32, Int32)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawPie_7_e59b9c35.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# GdiGraphics.DrawPie Method (Pen, Int32, Int32, Int32, Int32, Int32, Int32)
 
Draws a pie shape.
 
**Namespace:** [Aurigma.GraphicsMill.Drawing](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub DrawPie ( _pen As Pen, _x As Integer, _y As Integer, _width As Integer, _height As Integer, _startAngle As Integer, _sweepAngle As Integer _
)
```
 
```csharp
public void DrawPie(Pen pen,int x,int y,int width,int height,int startAngle,int sweepAngle
)
```
 
### Parameters
 
 - pen
     - Type: [Aurigma.GraphicsMill.Drawing.Pen](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_Pen.htm.md)
 [Pen](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_Pen.htm.md) object which is used to outline a pie.

 - x
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
X-coordinate of the top left corner the bounding rectangle for the ellipse (see **Remarks** section).

 - y
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Y-coordinate of the top left corner of the bounding rectangle for the ellipse (see **Remarks** section).

 - width
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Width of the bounding rectangle for the ellipse (see **Remarks** section).

 - height
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Height of the bounding rectangle for the ellipse (see **Remarks** section).

 - startAngle
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
An angle between x-axis and the first radial line which defines a sector on the ellipse.

 - sweepAngle
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
An angle between first and second radial line which defines a sector on the ellipse.
 
## Remarks
 Pie is an arc + two lines connecting arc ends with the center of the ellipse. In other words pie is defined with a tightest bounding rectangle of the ellipse and two angles which specifies necessary ellipse sector. 
All the coordinates are measured in units specified with [Unit](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_UnitConverterObject_Unit.htm.md) property.

To fill a pie shape, use [FillPie(Brush, Int32, Int32, Int32, Int32, Int32, Int32)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_GdiGraphics_FillPie_7_1e07a880.htm.md) method.
   
## See Also

### Reference

- [GdiGraphics Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md)
- [DrawPie Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawPie.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
