Table of Contents

Method FillRectangle

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

FillRectangle(Rectangle, Color32)

Fills the interior of the specified rectangle with a solid color.

public Canvas FillRectangle(Rectangle rect, Color32 color)

Parameters

rect Rectangle

The rectangle to fill.

color Color32

The fill color.

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var canvas = new Canvas(image);
canvas.FillRectangle(
    Rectangle.FromSize(20, 20, 160, 80),
    new Color32(0, 120, 215));

Exceptions

ArgumentNullException

Thrown if rect is null.

FillRectangle(Rectangle, Brush)

Fills the interior of the specified rectangle using the given brush.

public Canvas FillRectangle(Rectangle rect, Brush brush)

Parameters

rect Rectangle

The rectangle to fill.

brush Brush

The brush that defines the fill color.

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var brush = new Brush(new Color32(0, 120, 215));
var canvas = new Canvas(image);
canvas.FillRectangle(Rectangle.FromSize(20, 20, 160, 80), brush);

Exceptions

ArgumentNullException

Thrown if rect or brush is null.