当前位置:首页 科普知识 CreateRoundRectRgn

CreateRoundRectRgn

发布时间:2023-09-14 18:28:20

CreateRoundRectRgn 是这个CreateRoundRectRgn函数创建的一个带圆角的矩形区域。

CreateRoundRectRgn介绍

CreateRoundRectRgn 是这个CreateRoundRectRgn函数创建的一个带圆角的矩形区域。

CreateRoundRectRgn

CreateRoundRectRgn定义

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

CreateRoundRectRgn参数

nLeftRect

指定了x坐标的左上角区域逻辑单位。

nTopRect

指定了y坐标的左上角区域逻辑单位。

nRightRect

指定了x坐标的右下角区域逻辑单位。

nBottomRect

指定了y坐标的右下角区域逻辑单位。

nWidthEllipse

指定创建圆角的宽度逻辑单位。

nHeightEllipse

指定创建圆角的高度逻辑单位。

CreateRoundRectRgn

CreateRoundRectRgn返回值

如果函数成功,返回该区域的句柄。

如果函数失败,返回NULL。

在Windows NT/2000/XP中: 取得错误信息, 调用GetLastError。

CreateRoundRectRgn说明

Region coordinates are represented as 27-bit signed integers.

系统要求 :

Windows NT/2000/XP: 包括 Windows NT 3.1 和更晚的版本。

Windows 95/98/Me: 包括 Windows 95 和更晚的版本。

头文件: 在 Wingdi.h 中定义; 在 Windows.h 中包括。

库文件: 使用 Gdi32.lib.

CreateRoundRectRgnVB声明

Declare Function CreateRoundRectRgn Lib "gdi32" Alias "CreateRoundRectRgn" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long

CreateRoundRectRgn说明

创建一个圆角矩形,该矩形由X1,Y1-X2,Y2确定,并由X3,Y3确定的椭圆描述圆角弧度 返回值 Long,执行成功则为区域句柄,失败则为0

CreateRoundRectRgn参数表

X1,Y1 Long,矩形左上角的X,Y坐标

X2,Y2 Long,矩形右下角的X,Y坐标

CreateRoundRectRgn

X3 Long,圆角椭圆的宽。其范围从0(没有圆角)到矩形宽(全圆)

Y3 Long,圆角椭圆的高。其范围从0(没有圆角)到矩形高(全圆)

CreateRoundRectRgn注解

不用时一定要用DeleteObject函数删除该区域

用该函数创建的区域与用RoundRect API函数画的圆角矩形不完全相同,因为本矩形的右边和下边不包括在区域之内

温馨提示:
本文【CreateRoundRectRgn】由作者 爱百科 转载提供。 该文观点仅代表作者本人, 自学教育网 信息发布平台,仅提供信息存储空间服务, 若存在侵权问题,请及时联系管理员或作者进行删除。
(c)2008-2025 自学教育网 All Rights Reserved 汕头市灵创科技有限公司
粤ICP备2024240640号-6