45fan.com - 路饭网
首页
路由器设置
无线路由器
路由器密码
网络频道
手机频道
电脑频道
图库频道
问答中心
搜索:
智能搜索
搜索标题
您的位置
:
主页
>
网络频道
> 阅读资讯:有什么样的方法能够在vb.net中获取圆角矩形?
有什么样的方法能够在vb.net中获取圆角矩形?
2016-09-03 20:25:29 来源:www.45fan.com 【
大
中
小
】
有什么样的方法能够在vb.net中获取圆角矩形?
'
方法一
Private
FunctionGetRoundedRectPath()
Function
GetRoundedRectPath(
ByVal
rect
As
Rectangle,
ByVal
radius
As
Integer
)
As
System.Drawing.Drawing2D.GraphicsPath
rect.Offset(
-
1
,
-
1
)
Dim
RoundRect
As
New
Rectangle(rect.Location,
New
Size(radius
-
1
,radius
-
1
))
Dim
path
As
New
System.Drawing.Drawing2D.GraphicsPath
path.AddArc(RoundRect,
180
,
90
)
'
左上角
RoundRect.X
=
rect.Right
-
radius
'
右上角
path.AddArc(RoundRect,
270
,
90
)
RoundRect.Y
=
rect.Bottom
-
radius
'
右下角
path.AddArc(RoundRect,
0
,
90
)
RoundRect.X
=
rect.Left
'
左下角
path.AddArc(RoundRect,
90
,
90
)
path.CloseFigure()
Return
path
EndFunction
'
方法二()
Private
FunctionCreateRoundedRectPath()
Function
CreateRoundedRectPath(
ByVal
rect
As
Rectangle,
ByVal
radius
As
Integer
)
As
System.Drawing.Drawing2D.GraphicsPath
Dim
RoundRect
As
New
System.Drawing.Drawing2D.GraphicsPath
RoundRect.AddLine(rect.Left
+
radius
-
2
,rect.Top
-
1
,rect.Right
-
radius,rect.Top
-
1
)
'
顶端
RoundRect.AddArc(rect.Right
-
radius,rect.Top
-
1
,radius,radius,
270
,
90
)
'
右上角
RoundRect.AddLine(rect.Right,rect.Top
+
radius,rect.Right,rect.Bottom
-
radius)
'
右边
RoundRect.AddArc(rect.Right
-
radius,rect.Bottom
-
radius,radius,radius,
0
,
90
)
'
右下角
RoundRect.AddLine(rect.Right
-
radius,rect.Bottom,rect.Left
+
radius,rect.Bottom)
'
底边
RoundRect.AddArc(rect.Left
-
1
,rect.Bottom
-
radius,radius,radius,
90
,
90
)
'
左下角
RoundRect.AddLine(rect.Left
-
1
,rect.Top
+
radius,rect.Left
-
1
,rect.Bottom
-
radius)
'
左边
RoundRect.AddArc(rect.Left
-
1
,rect.Top
-
1
,radius,radius,
180
,
90
)
'
左上角
Return
RoundRect
EndFunction
本文地址:
http://www.45fan.com/a/question/71915.html
Tags:
获取
圆角
VB.NET
编辑:路饭网
上一篇:
曼陀罗思考法介绍
下一篇:
如何使用ARP实现透明的子网网关?
相关文章列表
如何使用mongodb随机获取一条记录?
如何在mongodb中随机获取1条记录?
怎么样利用Python获取操作系统信息实例?
如何通过Python语言实现获取主机名根据端
Mysql获取id最大值、表的记录总数时会出
如何获取魔兽世界7.0冰河鲤鱼?
在Linux中通过scp命令获取远程文件?
卡耐基获取幸福的诀窍
怎么样获取客户端MAC、IP地址、计算机名
如何获取win32 API窗口句柄?
推广内容
推荐阅读
热门推荐
推荐文章
·
欢乐颂五美晒合照 齐呼:We are back!!
·
Google AdSense广告业务也被干扰,掉包严
·
京东和淘宝二者对比有什么区别?
·
输入新浪微博的验证码老是错误怎么办?
·
google adsense打不开怎么办?免翻墙打开
·
在淘宝网买东西要注意哪些事项?网友必备
·
阿里提供免费公共DNS服,阿里公共dns地址
·
如何进行小米真人认证?小米官方真人认证
·
怎么用PS制作出真实的眼睛?
·
招财宝有什么作用?招财宝不仅仅是余额宝
·
路饭网官方微信公众平台开通啦!赶快扫描
·
路由器连接检测工具 检测电脑上不了网的
关于我们
|
联系我们
|
友情链接
|
网站地图
|
Sitemap
|
App
|
返回顶部