Table of Contents

Method FillBorderRectangle

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

FillBorderRectangle(Graphics, ref DrawBorderParams)

Fills a rectangle with a specified brush and optionally draws a border around it.

public static void FillBorderRectangle(Graphics canvas, ref DrawingUtils.DrawBorderParams prm)

Parameters

canvas Graphics

The Graphics where to draw.

prm DrawingUtils.DrawBorderParams

A reference to a DrawingUtils.DrawBorderParams structure that contains the parameters for the operation, including the rectangle to fill, the brush to use, the border settings, and the canvas.

Remarks

This method performs the following actions based on the provided parameters:

  • If a brush is specified, the rectangle is filled using the brush.
  • If a border is specified and HasBorder is true, the border is drawn around the rectangle.
  • If both a brush and a border are specified, the method ensures the border and fill are rendered appropriately, including support for rounded corners if the border specifies a corner radius.
If neither a brush nor a valid border is provided, the method performs no action.

FillBorderRectangle(Graphics, RectD, Brush?, BorderSettings?, bool, AbstractControl?)

Fills rectangle background and draws its border using the specified border settings.

public static void FillBorderRectangle(this Graphics dc, RectD rect, Brush? brush, BorderSettings? border, bool hasBorder = true, AbstractControl? control = null)

Parameters

dc Graphics

Graphics where to draw.

rect RectD

Rectangle.

brush Brush

Brush to fill the rectangle.

border BorderSettings

Border settings.

hasBorder bool

Whether border is painted.

control AbstractControl

Control in which border is painted. Optional.