怎么用vb画一个逐渐生成的圆
2个回答
展开全部
Dim a As Single, X0 As Integer, Y0 As Integer, r As Integer
Const p = 3.14159
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
X0 = X: Y0 = Y: a = 0
PSet (X, Y)
Print "O" '标示圆心位置
'Me.Cls
r = InputBox("请输入>=500的半径值:")
Line (X0, Y0)-(X0 + r * Cos(0), Y0)
CurrentX = X0: CurrentY = Y0 - 150
Print "r=" & r '画出半径并标示
Me.DrawWidth = 2
Timer1.Enabled = True
Timer1.Interval = 20
End Sub
Private Sub Timer1_Timer()
PSet (X0 + r * Cos(a * p / 180), Y0 + r * Sin(a * p / 180))
a = a + 0.5
If a = 360 Then
'CurrentX = 0'可指定打印文字坐标
'CurrentY = 0
Print "画圆完成!" '在画圆完成的点即0度位置打印
Timer1.Enabled = False
End If
End Sub
Const p = 3.14159
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
X0 = X: Y0 = Y: a = 0
PSet (X, Y)
Print "O" '标示圆心位置
'Me.Cls
r = InputBox("请输入>=500的半径值:")
Line (X0, Y0)-(X0 + r * Cos(0), Y0)
CurrentX = X0: CurrentY = Y0 - 150
Print "r=" & r '画出半径并标示
Me.DrawWidth = 2
Timer1.Enabled = True
Timer1.Interval = 20
End Sub
Private Sub Timer1_Timer()
PSet (X0 + r * Cos(a * p / 180), Y0 + r * Sin(a * p / 180))
a = a + 0.5
If a = 360 Then
'CurrentX = 0'可指定打印文字坐标
'CurrentY = 0
Print "画圆完成!" '在画圆完成的点即0度位置打印
Timer1.Enabled = False
End If
End Sub
追问
谢谢!这个怎么做?用VB生成圆:在运行时每点一下窗体就生成一个半径随机,位置随机,颜色随机的实体圆,而且圆是由扇形逐渐变成完整的圆(点几下就生成几个圆)
追答
Dim a As Single, X0 As Integer, Y0 As Integer, r As Integer
Const p = 3.14159
Private Sub Form_Click()
Randomize
Timer1.Enabled = True
Timer1.Interval = 30
X0 = Rnd * 8000
Y0 = Rnd * 8000
r = Rnd * 2000 + 100
Me.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub
Private Sub Form_Load()
Me.WindowState = 2
Me.DrawWidth = 5
End Sub
Private Sub Timer1_Timer()
Line (X0, Y0)-(X0 + r * Cos(a * p / 180), Y0 + r * Sin(a * p / 180))
a = a + 0.5
End Sub
2015-05-11
展开全部
你好,从你的描述来看,不用过于担心,建议一周后复查B超看看胎儿的发育情况。
病情分析:
正常情况下孕5周左右B超可见宫腔内孕囊。
从B超结果看,宫腔内的液性暗区暂时不能确定就是孕囊。
指导意见:
建议暂观察,注意休息,避免性生活和剧烈运动,一周后复查B超,若可见卵黄囊和胚芽,则可确定是宫内妊娠。
病情分析:
正常情况下孕5周左右B超可见宫腔内孕囊。
从B超结果看,宫腔内的液性暗区暂时不能确定就是孕囊。
指导意见:
建议暂观察,注意休息,避免性生活和剧烈运动,一周后复查B超,若可见卵黄囊和胚芽,则可确定是宫内妊娠。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询