函数功能:
CreateRoundRectRgn 函数用于创建一个圆角矩形区域。
API 函数原型:
HRGN CreateRoundRectRgn( _In_ int nLeftRect, _In_ int nTopRect, _In_ int nRightRect, _In_ int nBottomRect, _In_ int nWidthEllipse, _In_ int nHeightEllipse );
参数解析:
|
参数 |
含义 |
|
nLeftRect |
指定圆角矩形区域左上角的 x 坐标,设备单位 |
|
nTopRect |
指定圆角矩形区域左上角的 y 坐标,设备单位 |
|
nRightRect |
指定圆角矩形区域右下角的 x 坐标,设备单位 |
|
nBottomRect |
指定圆角矩形区域右下角的 y 坐标,设备单位 |
|
nWidthEllipse |
指定用于创建圆角的椭圆的宽度,设备单位 |
|
nHeightEllipse |
指定用于创建圆角的椭圆的高度,设备单位 |
返回值:
1. 如果函数调用成功,返回值是圆角矩形区域的句柄(类型是 HRGN);
2. 如果函数调用失败,返回值是 NULL。
备注:
1. 当你不再需要这个 HRGN 对象,请使用 DeleteObject 函数删除它。
2. 矩形区域坐标用 27 位有符号整数表示。




