Table of Contents

Method DrawEllipse

Namespace
LMKit.Graphics.Drawing
Assembly
LM-Kit.NET.dll

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

ellipse Ellipse

The ellipse to outline.

color Color32

The stroke color.

thickness double

The stroke thickness in pixels. Must be greater than zero. Defaults to 1.

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var canvas = new Canvas(image);
canvas.DrawEllipse(
    Ellipse.Circle(100, 100, 50),
    new Color32(0, 0, 0),
    thickness: 2);

Exceptions

ArgumentNullException

Thrown if ellipse is null.

DrawEllipse(Ellipse, Pen)

Draws the outline of the specified ellipse using the given pen.

public Canvas DrawEllipse(Ellipse ellipse, Pen pen)

Parameters

ellipse Ellipse

The ellipse to outline.

pen Pen

The pen that defines the stroke color, thickness, and alignment.

Returns

Canvas

This Canvas instance for fluent chaining.

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 ellipse or pen is null.