visual basic 画图问题。作一个沿正弦曲线运动的小球的动画。代码如下
OptionExplicitDimkAsIntegerPrivateSubForm_Load()DimiAsIntegerForm1.Line(0,Form1.Heigh...
Option Explicit
Dim k As Integer
Private Sub Form_Load()
Dim i As Integer
Form1.Line (0, Form1.Height / 2)-(Form1.Width, Form1.Height / 2)
Form1.Line (Form1.Width / 2, 0)-(Form1.Width / 2, Form1.Height)
Form1.DrawWidth = 2
For i = 0 To 3600
PSet (2200 + i, 1200 * Sin(3.14 * i / (180 * 10)) + Form1.Height / 2)
Next i
End Sub
Private Sub Timer1_Timer()
If k < 3600 Then
k = k + 10
Else
k = 0
End If
Form1.Circle (2200 + k, 1200 * Sin(3.14 * k / (180 * 10)) + Form1.Height / 2), 40
End Sub
先我要实现,把timer事件里画的前一个圆清除掉,我应该怎么做呢?在不把前面画好的直线及正弦曲线删除的情况下。不使用,form1.CLS还有什么方法。谢谢 展开
Dim k As Integer
Private Sub Form_Load()
Dim i As Integer
Form1.Line (0, Form1.Height / 2)-(Form1.Width, Form1.Height / 2)
Form1.Line (Form1.Width / 2, 0)-(Form1.Width / 2, Form1.Height)
Form1.DrawWidth = 2
For i = 0 To 3600
PSet (2200 + i, 1200 * Sin(3.14 * i / (180 * 10)) + Form1.Height / 2)
Next i
End Sub
Private Sub Timer1_Timer()
If k < 3600 Then
k = k + 10
Else
k = 0
End If
Form1.Circle (2200 + k, 1200 * Sin(3.14 * k / (180 * 10)) + Form1.Height / 2), 40
End Sub
先我要实现,把timer事件里画的前一个圆清除掉,我应该怎么做呢?在不把前面画好的直线及正弦曲线删除的情况下。不使用,form1.CLS还有什么方法。谢谢 展开
2个回答
展开全部
'用Form的BackColor把前一个圆覆盖掉
Dim k As Integer
Private Sub Form_Load()
Form1.ScaleWidth = 3600 '把屏幕坐标刻度改了下,画出来好看点
Form1.ScaleHeight = 2500
Form1.DrawWidth = 2
Timer1.Interval = 10
End Sub
Private Sub Form_Resize() '改变窗口尺寸,坐标不变
Form1.Cls '这里的Cls是改变大小时用的
Form1.ScaleWidth = 3600
Form1.ScaleHeight = 2500
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
Form1.Line (0, Form1.ScaleHeight / 2)-(Form1.ScaleWidth, Form1.ScaleHeight / 2)
Form1.Line (Form1.ScaleWidth / 2, 0)-(Form1.ScaleWidth / 2, Form1.ScaleHeight)
For i = 0 To 3600
PSet (i, 1200 * Sin(3.14 * i / (180 * 10)) + Form1.ScaleHeight / 2)
Next
Form1.Circle (k, 1200 * Sin(3.14 * k / (180 * 10)) + Form1.ScaleHeight / 2), 40, Form1.BackColor '把前一点点画成背景色
If k < 3600 Then
k = k + 10
Else
k = 0
End If
Form1.Circle (k, 1200 * Sin(3.14 * k / (180 * 10)) + Form1.ScaleHeight / 2), 40, vbRed
End Sub
Dim k As Integer
Private Sub Form_Load()
Form1.ScaleWidth = 3600 '把屏幕坐标刻度改了下,画出来好看点
Form1.ScaleHeight = 2500
Form1.DrawWidth = 2
Timer1.Interval = 10
End Sub
Private Sub Form_Resize() '改变窗口尺寸,坐标不变
Form1.Cls '这里的Cls是改变大小时用的
Form1.ScaleWidth = 3600
Form1.ScaleHeight = 2500
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
Form1.Line (0, Form1.ScaleHeight / 2)-(Form1.ScaleWidth, Form1.ScaleHeight / 2)
Form1.Line (Form1.ScaleWidth / 2, 0)-(Form1.ScaleWidth / 2, Form1.ScaleHeight)
For i = 0 To 3600
PSet (i, 1200 * Sin(3.14 * i / (180 * 10)) + Form1.ScaleHeight / 2)
Next
Form1.Circle (k, 1200 * Sin(3.14 * k / (180 * 10)) + Form1.ScaleHeight / 2), 40, Form1.BackColor '把前一点点画成背景色
If k < 3600 Then
k = k + 10
Else
k = 0
End If
Form1.Circle (k, 1200 * Sin(3.14 * k / (180 * 10)) + Form1.ScaleHeight / 2), 40, vbRed
End Sub
Sievers分析仪
2024-10-13 广告
2024-10-13 广告
是的。传统上,对于符合要求的内毒素检测,最终用户必须从标准内毒素库存瓶中构建至少一式两份三点标准曲线;必须有重复的阴性控制;每个样品和PPC必须一式两份。有了Sievers Eclipse内毒素检测仪,这些步骤可以通过使用预嵌入的内毒素标准...
点击进入详情页
本回答由Sievers分析仪提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询