vb.net中绘制圆的代码是什么?
展开全部
Dim myGraphics As Graphics = Me.CreateGraphics '声明并创建一个Graphics对象
Dim myPen As Pen = New Pen(Drawing.Color.Black, 3) '声明一个画笔,并设定颜色和粗细
myPen.DashStyle = Drawing.Drawing2D.DashStyle.Solid '线型,Solid是实线
myGraphics.DrawEllipse(myPen, 200, 200, 100, 100) '画圆,数值依次是:横坐标、纵坐标、宽度和高度(宽高相同为正圆,否则为椭圆)
myGraphics.Dispose() '释放Graphics占用的资源
Dim myPen As Pen = New Pen(Drawing.Color.Black, 3) '声明一个画笔,并设定颜色和粗细
myPen.DashStyle = Drawing.Drawing2D.DashStyle.Solid '线型,Solid是实线
myGraphics.DrawEllipse(myPen, 200, 200, 100, 100) '画圆,数值依次是:横坐标、纵坐标、宽度和高度(宽高相同为正圆,否则为椭圆)
myGraphics.Dispose() '释放Graphics占用的资源
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询