CreateRoundRectRgn

来源:互联网 发布:强力删除软件 编辑:程序博客网 时间:2024/05/21 22:46

CreateRoundRectRgn

  The CreateRoundRectRgn function creates a rectangular region with rounded corners. 
  定义 
  HRGN CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse); 
  参数 
  nLeftRect 
  [in] Specifies the x-coordinate of the upper-left corner of the region in logical units. 
  nTopRect 
  [in] Specifies the y-coordinate of the upper-left corner of the region in logical units. 
  nRightRect 
  [in] Specifies the x-coordinate of the lower-right corner of the region in logical units. 
  nBottomRect 
  [in] Specifies the y-coordinate of the lower-right corner of the region in logical units. 
  nWidthEllipse 
  [in] Specifies the width of the ellipse used to create the rounded corners in logical units. 
  nHeightEllipse 
  [in] Specifies the height of the ellipse used to create the rounded corners in logical units. 
  返回值 
  If the function succeeds, the return value is the handle to the region.
  If the function fails, the return value is NULL.
  Windows NT/2000/XP: To get extended error information, call GetLastError. 
  说明 
  Region coordinates are represented as 27-bit signed integers. 
  系统要求 
  Windows NT/2000/XP: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Wingdi.h; include Windows.h.
  Library: Use Gdi32.lib. 
  以上为MSDN解释!~
  VB声明:
  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
  说明:
  创建一个圆角矩形,该矩形由X1,Y1-X2,Y2确定,并由X3,Y3确定的椭圆描述圆角弧度 返回值 Long,执行成功则为区域句柄,失败则为0
  参数表 参数 类型及说明:
  X1,Y1 Long,矩形左上角的X,Y坐标
  X2,Y2 Long,矩形右下角的X,Y坐标
  X3 Long,圆角椭圆的宽。其范围从0(没有圆角)到矩形宽(全圆)
  Y3 Long,圆角椭圆的高。其范围从0(没有圆角)到矩形高(全圆)
  注解 
  不用时一定要用DeleteObject函数删除该区域
  用该函数创建的区域与用RoundRect API函数画的圆角矩形不完全相同,因为本矩形的右边和下边不包括在区域之内 

原创粉丝点击