drawArc method
Draws an arc representing a portion of an ellipse specified by a Rect structure.
//Creates a new PDF document.
PdfDocument doc = PdfDocument()
..pages
.add()
.graphics
//Draw Arc.
.drawArc(Rect.fromLTWH(10, 10, 100, 200), 90, 270, pen: PdfPens.red);
//Saves the document.
List<int> bytes = doc.save();
//Dispose the document.
doc.dispose();
Implementation
void drawArc(Rect bounds, double startAngle, double sweepAngle,
{PdfPen? pen}) {
if (sweepAngle != 0) {
_helper._beginMarkContent();
_helper._stateControl(pen, null, null, null);
_constructArcPath(bounds.left, bounds.top, bounds.left + bounds.width,
bounds.top + bounds.height, startAngle, sweepAngle);
_drawPath(pen, null, PdfFillMode.winding, false);
_helper.endMarkContent();
}
}