如何创建圆和扩展圆 [英] How to create Circle and Expand the Circle

查看:115
本文介绍了如何创建圆和扩展圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在表单中间创建一个圆.
当我单击按钮时,单次圆圈大小应增加到表单大小.圆周围的数字应与圆的大小一起显示.

2
例如:1
2 1圈子1 2
1
2

How to create a circle Middle of the Form.
When I Click the Button Single time Circle Size should be Increased upto Form Size. Around circle Numbers should be display along with circle size.

2
Ex : 1
2 1 Circle 1 2
1
2

推荐答案

此处是示例代码,用于绘制具有点和半径的圆.使用此功能,您可以根据屏幕分辨率绘制中心和整个圆.

Here is the sample code to draw circle with point and radius. Using this function, you can draw centre and full circle based on the screen resolution.

Private Sub DrawCircle(ByVal cp As Point, ByVal radius As Integer)
      Dim gr As Graphics
      gr = Panel1.CreateGraphics
      Dim rect As Rectangle = New Rectangle(cp.X - radius, cp.Y - radius, 2 * radius, 2 * radius)
      gr.DrawEllipse(Pens.Black, rect)

  End Sub


这篇关于如何创建圆和扩展圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆