Doc AddPie Function. Adds a pie slice to the current page. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

Adds a pie slice to the current page.

 

   
Syntax  

[C#]
int AddPie(double angleStart, double angleEnd, bool filled)

[Visual Basic]
Function AddPie(angleStart As Double, angleEnd As Double, filled As Boolean) As Integer

 

   

Params
 
Name Description
angleStart The start angle of the pie slice in degrees.
angleEnd The end angle of the pie slice in degrees.
filled Whether to fill the pie slice rather than simply outline it.
return The Object ID of the newly added Graphic Object.

 

   

Notes
 

Adds a pie slice to the current page. The slice is drawn in the current color at the current width and with the current options.

The pie slice represents a segment of the oval which would fill the current rectangle. Drawing starts at the start angle and the arc is swept out until the end angle is reached. Angles are measured anti-clockwise with zero at three o'clock. The slice may be outlined or filled depending on the values passed to the function.

The AddPie function returns the Object ID of the newly added Graphic Object.

 

   

Example
 

The following code adds two pie slices to a document.

[C#]
Doc theDoc = new Doc();
theDoc.Width = 80;
theDoc.Rect.Inset(50, 50);
theDoc.Color.String = "255 0 0";
theDoc.AddPie(0, 90, true);
theDoc.Color.String = "0 255 0";
theDoc.AddPie(180, 270, false);
theDoc.Save(Server.MapPath("docaddpie.pdf"));
theDoc.Clear();

[Visual Basic]
Dim theDoc As Doc = New Doc()
theDoc.Width = 80
theDoc.Rect.Inset(50, 50)
theDoc.Color.String = "255 0 0"
theDoc.AddPie(0, 90, True)
theDoc.Color.String = "0 255 0"
theDoc.AddPie(180, 270, False)
theDoc.Save(Server.MapPath("docaddpie.pdf"))
theDoc.Clear()


docaddpie.pdf