GraphicsExtensionsFillRoundedRectangle(Graphics, Brush, Rectangle, Int32, Int32, Int32, Int32) Method

Fills a rounded rectangle with the specified Brush, applying a custom corner radius to each corner.

Definition

Namespace: KGySoft.Drawing
Assembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 9.0.0
C#
public static void FillRoundedRectangle(
	this Graphics graphics,
	Brush brush,
	Rectangle bounds,
	int radiusTopLeft,
	int radiusTopRight,
	int radiusBottomRight,
	int radiusBottomLeft
)

Parameters

graphics  Graphics
The Graphics instance to draw on.
brush  Brush
The Brush to use for filling the rounded rectangle.
bounds  Rectangle
The bounding rectangle that defines the rounded rectangle.
radiusTopLeft  Int32
The size of the top-left corner radius of the rounded rectangle.
radiusTopRight  Int32
The size of the top-right corner radius of the rounded rectangle.
radiusBottomRight  Int32
The size of the bottom-right corner radius of the rounded rectangle.
radiusBottomLeft  Int32
The size of the bottom-left corner radius of the rounded rectangle.

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 a corner radius parameter is negative, its absolute value will be used. If the sum of any adjacent corner radius parameters is greater than the corresponding side of the bounding rectangle, then all corner radius parameters will be scaled down proportionally to fit into the bounding rectangle.

See Also