Table of Contents

Method DrawFilledRoundedRectangle

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

DrawFilledRoundedRectangle(RoundedRectangle, Color32, Color32, double)

Fills the interior of the specified rounded rectangle and then draws its outline, using a solid fill color and a solid stroke color with the given thickness.

public Canvas DrawFilledRoundedRectangle(RoundedRectangle roundedRect, Color32 fillColor, Color32 strokeColor, double strokeThickness = 1)

Parameters

roundedRect RoundedRectangle

The rounded rectangle to fill and outline.

fillColor Color32

The interior fill color.

strokeColor Color32

The outline stroke color.

strokeThickness 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.DrawFilledRoundedRectangle(
    rr,
    fillColor: new Color32(200, 230, 255),
    strokeColor: new Color32(0, 0, 0),
    strokeThickness: 2);

Exceptions

ArgumentNullException

Thrown if roundedRect is null.

DrawFilledRoundedRectangle(RoundedRectangle, Brush, Pen)

Fills the interior of the specified rounded rectangle and then draws its outline, using the given brush and pen.

public Canvas DrawFilledRoundedRectangle(RoundedRectangle roundedRect, Brush brush, Pen pen)

Parameters

roundedRect RoundedRectangle

The rounded rectangle to fill and outline.

brush Brush

The brush that defines the fill color.

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 brush = new Brush(new Color32(200, 230, 255));
var pen = new Pen(new Color32(0, 0, 0), 2);
var canvas = new Canvas(image);
canvas.DrawFilledRoundedRectangle(rr, brush, pen);

Exceptions

ArgumentNullException

Thrown if roundedRect, brush, or pen is null.