Table of Contents

Method DrawRoundedRectangle

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

DrawRoundedRectangle(RoundedRectangle, Color32, double)

Draws the outline of the specified rounded rectangle with a solid color and thickness.

public Canvas DrawRoundedRectangle(RoundedRectangle roundedRect, Color32 color, double thickness = 1)

Parameters

roundedRect RoundedRectangle

The rounded rectangle 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 rr = RoundedRectangle.FromSize(10, 10, 200, 100, cornerRadius: 15);
var canvas = new Canvas(image);
canvas.DrawRoundedRectangle(rr, new Color32(0, 0, 0), thickness: 2);

Exceptions

ArgumentNullException

Thrown if roundedRect is null.

DrawRoundedRectangle(RoundedRectangle, Pen)

Draws the outline of the specified rounded rectangle using the given pen.

public Canvas DrawRoundedRectangle(RoundedRectangle roundedRect, Pen pen)

Parameters

roundedRect RoundedRectangle

The rounded rectangle to outline.

pen Pen

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

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var rr = RoundedRectangle.FromSize(10, 10, 200, 100, cornerRadius: 15);
var pen = new Pen(new Color32(255, 0, 0), 3);
var canvas = new Canvas(image);
canvas.DrawRoundedRectangle(rr, pen);

Exceptions

ArgumentNullException

Thrown if roundedRect or pen is null.