CreateRoundRectRgn function (wingdi.h)

The CreateRoundRectRgn function creates a rectangular region with rounded corners.

Syntax

HRGN CreateRoundRectRgn(
  [in] int x1,
  [in] int y1,
  [in] int x2,
  [in] int y2,
  [in] int w,
  [in] int h
);

Parameters

[in] x1

Specifies the x-coordinate of the upper-left corner of the region in device units.

[in] y1

Specifies the y-coordinate of the upper-left corner of the region in device units.

[in] x2

Specifies the x-coordinate of the lower-right corner of the region in device units.

[in] y2

Specifies the y-coordinate of the lower-right corner of the region in device units.

[in] w

Specifies the width of the ellipse used to create the rounded corners in device units.

[in] h

Specifies the height of the ellipse used to create the rounded corners in device units.

Return value

If the function succeeds, the return value is the handle to the region.

If the function fails, the return value is NULL.

Remarks

When you no longer need the HRGN object call the DeleteObject function to delete it.

Region coordinates are represented as 27-bit signed integers.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

CreatePolyPolygonRgn

CreatePolygonRgn

CreateRectRgn

CreateRectRgnIndirect

DeleteObject

ExtCreateRegion

GetRegionData

Region Functions

Regions Overview

SelectObject