Method DrawFilledRoundedRectangle
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
roundedRectRoundedRectangleThe rounded rectangle to fill and outline.
fillColorColor32The interior fill color.
strokeColorColor32The outline stroke color.
strokeThicknessdoubleThe stroke thickness in pixels. Must be greater than zero. Defaults to 1.
Returns
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
roundedRectis 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
roundedRectRoundedRectangleThe rounded rectangle to fill and outline.
brushBrushThe brush that defines the fill color.
penPenThe pen that defines the stroke color, thickness, and alignment.
Returns
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, orpenis null.