Method FillRectangle
FillRectangle(Rectangle, Color32)
Fills the interior of the specified rectangle with a solid color.
public Canvas FillRectangle(Rectangle rect, Color32 color)
Parameters
Returns
Examples
var canvas = new Canvas(image);
canvas.FillRectangle(
Rectangle.FromSize(20, 20, 160, 80),
new Color32(0, 120, 215));
Exceptions
- ArgumentNullException
Thrown if
rectis null.
FillRectangle(Rectangle, Brush)
Fills the interior of the specified rectangle using the given brush.
public Canvas FillRectangle(Rectangle rect, Brush brush)
Parameters
Returns
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
rectorbrushis null.