Method DrawRoundedRectangle
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
roundedRectRoundedRectangleThe rounded rectangle to outline.
colorColor32The stroke color.
thicknessdoubleThe 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.DrawRoundedRectangle(rr, new Color32(0, 0, 0), thickness: 2);
Exceptions
- ArgumentNullException
Thrown if
roundedRectis null.
DrawRoundedRectangle(RoundedRectangle, Pen)
Draws the outline of the specified rounded rectangle using the given pen.
public Canvas DrawRoundedRectangle(RoundedRectangle roundedRect, Pen pen)
Parameters
roundedRectRoundedRectangleThe rounded rectangle to outline.
penPenThe pen that defines the stroke color, thickness, and alignment.
Returns
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
roundedRectorpenis null.