Method DrawEllipse
DrawEllipse(Ellipse, Color32, double)
Draws the outline of the specified ellipse with a solid color and thickness.
public Canvas DrawEllipse(Ellipse ellipse, Color32 color, double thickness = 1)
Parameters
ellipseEllipseThe ellipse to outline.
colorColor32The stroke color.
thicknessdoubleThe stroke thickness in pixels. Must be greater than zero. Defaults to 1.
Returns
Examples
var canvas = new Canvas(image);
canvas.DrawEllipse(
Ellipse.Circle(100, 100, 50),
new Color32(0, 0, 0),
thickness: 2);
Exceptions
- ArgumentNullException
Thrown if
ellipseis null.
DrawEllipse(Ellipse, Pen)
Draws the outline of the specified ellipse using the given pen.
public Canvas DrawEllipse(Ellipse ellipse, Pen pen)
Parameters
ellipseEllipseThe ellipse to outline.
penPenThe pen that defines the stroke color, thickness, and alignment.
Returns
Examples
var pen = new Pen(new Color32(255, 0, 0), 3);
var canvas = new Canvas(image);
canvas.DrawEllipse(Ellipse.FromCenter(200, 150, 80, 50), pen);
Exceptions
- ArgumentNullException
Thrown if
ellipseorpenis null.