Graphics.FillRectangle

FillRectangle(Brush, Rectangle)

填充由 Rectangle 结构指定的矩形内部。

public void FillRectangle(Brush brush, Rectangle rect)
参数类型描述
brushBrushBrush,决定填充的特性。
rectRectangleRectangle 结构,表示要填充的矩形。

异常

异常条件
ArgumentNullExceptionbrush 为 null。

另请参见


FillRectangle(Brush, RectangleF)

填充由 RectangleF 结构指定的矩形内部。

public void FillRectangle(Brush brush, RectangleF rect)
参数类型描述
brushBrushBrush,决定填充的特性。
rectRectangleFRectangleF 结构,表示要填充的矩形。

异常

异常条件
ArgumentNullExceptionbrush 为 null。

另请参见


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

填充由一对坐标、宽度和高度指定的矩形的内部。

public void FillRectangle(Brush brush, float x, float y, float width, float height)
参数类型描述
brushBrushBrush,决定填充的特性。
x单精度要填充的矩形左上角的 x 坐标。
y单精度要填充的矩形左上角的 y 坐标。
宽度单精度要填充的矩形的宽度。
高度单精度要填充的矩形的高度。

异常

异常条件
ArgumentNullExceptionbrush 为 null。

另请参见


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

填充由一对坐标、宽度和高度指定的矩形的内部。

public void FillRectangle(Brush brush, int x, int y, int width, int height)
参数类型描述
brushBrushBrush,决定填充的特性。
xInt32要填充的矩形左上角的 x 坐标。
yInt32要填充的矩形左上角的 y 坐标。
宽度Int32要填充的矩形的宽度。
高度Int32要填充的矩形的高度。

异常

异常条件
ArgumentNullExceptionbrush 为 null。

另请参见