Version

CreateRoundedRegion(Rectangle,Int32,Corners) Method

Returns a System.Drawing.Region from the specified rect, with rounded corners with the specified radius.
Syntax
'Declaration
 
Public Overloads Shared Function CreateRoundedRegion( _
   ByVal rect As Rectangle, _
   ByVal radius As Integer, _
   ByVal roundedCorners As Corners _
) As Region
public static Region CreateRoundedRegion( 
   Rectangle rect,
   int radius,
   Corners roundedCorners
)

Parameters

rect
The System.Drawing.Rectangle on which the returned System.Drawing.Region is based.
radius
The radius of the circle whose quadrants create the rounded corners.
roundedCorners
The Corners bitflags value which define the corners that are to be rounded in the returned Region. Note that the corners which are not included in this value are completed by perpendicular lines.

Return Value

A System.Drawing.Region with the same dimensions as the specified rect and rounded corners. Note that the caller is responsible for disposal of the returned object.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also