Graphics.FillRectangle

FillRectangle(Brush, Rectangle)

Fills the interior of a rectangle specified by a Rectangle structure.

public void FillRectangle(Brush brush, Rectangle rect)
ParameterTypeDescription
brushBrushBrush that determines the characteristics of the fill.
rectRectangleRectangle structure that represents the rectangle to fill.

Exceptions

exceptioncondition
ArgumentNullExceptionbrush is null.

See Also


FillRectangle(Brush, RectangleF)

Fills the interior of a rectangle specified by a RectangleF structure.

public void FillRectangle(Brush brush, RectangleF rect)
ParameterTypeDescription
brushBrushBrush that determines the characteristics of the fill.
rectRectangleFRectangleF structure that represents the rectangle to fill.

Exceptions

exceptioncondition
ArgumentNullExceptionbrush is null.

See Also


FillRectangle(Brush, float, float, float, float)

Fills the interior of a rectangle specified by a pair of coordinates, a width and a height.

public void FillRectangle(Brush brush, float x, float y, float width, float height)
ParameterTypeDescription
brushBrushBrush that determines the characteristics of the fill.
xSingleThe x-coordinate of the upper-left corner of the rectangle to fill.
ySingleThe y-coordinate of the upper-left corner of the rectangle to fill.
widthSingleWidth of the rectangle to fill.
heightSingleHeight of the rectangle to fill.

Exceptions

exceptioncondition
ArgumentNullExceptionbrush is null.

See Also


FillRectangle(Brush, int, int, int, int)

Fills the interior of a rectangle specified by a pair of coordinates, a width and a height.

public void FillRectangle(Brush brush, int x, int y, int width, int height)
ParameterTypeDescription
brushBrushBrush that determines the characteristics of the fill.
xInt32The x-coordinate of the upper-left corner of the rectangle to fill.
yInt32The y-coordinate of the upper-left corner of the rectangle to fill.
widthInt32Width of the rectangle to fill.
heightInt32Height of the rectangle to fill.

Exceptions

exceptioncondition
ArgumentNullExceptionbrush is null.

See Also