2 out of 3 rated this helpful - Rate this topic

CreateRoundRectRgn function

Applies to: desktop apps only

The CreateRoundRectRgn function creates a rectangular region with rounded corners.

Syntax

HRGN CreateRoundRectRgn(
  __in  int nLeftRect,
  __in  int nTopRect,
  __in  int nRightRect,
  __in  int nBottomRect,
  __in  int nWidthEllipse,
  __in  int nHeightEllipse
);

Parameters

nLeftRect [in]

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

nTopRect [in]

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

nRightRect [in]

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

nBottomRect [in]

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

nWidthEllipse [in]

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

nHeightEllipse [in]

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

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Regions Overview
Region Functions
CreatePolygonRgn
CreatePolyPolygonRgn
CreateRectRgn
CreateRectRgnIndirect
ExtCreateRegion
GetRegionData
DeleteObject
SelectObject

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ