GraphicsExtensionsFillRoundedRectangle(Graphics, Brush, RectangleF, Single) Method

Fills a rounded rectangle with the specified Brush, applying the same corner radius to all corners.

Definition

Namespace: KGySoft.Drawing
Assembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 9.2.0
C#
public static void FillRoundedRectangle(
	this Graphics graphics,
	Brush brush,
	RectangleF bounds,
	float cornerRadius
)

Parameters

graphics  Graphics
The Graphics instance to draw on.
brush  Brush
The Brush to use for filling the rounded rectangle.
bounds  RectangleF
The bounding rectangle that defines the rounded rectangle.
cornerRadius  Single
The size of the corner radius of the rounded rectangle for all corners.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Graphics. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

If cornerRadius is negative, the absolute value will be used. If it is greater than the half of the smaller side of the bounding rectangle, it will be adjusted to the half of the smaller side, so the result will be an oval shape. If the cornerRadius is 0, a simple filled rectangle will be drawn.

See Also