VB 画图 让一个点沿曲线移动
现在已有一条曲线,曲线的坐标已知,加入一个滚动条,控制圆点的X坐标,让圆点沿曲线移动。我现在做的能画出曲线和圆点,但移动滚动条的时候整个曲线上都是圆点了,所以想在圆点移动...
现在已有一条曲线,曲线的坐标已知,加入一个滚动条,控制圆点的X坐标,让圆点沿曲线移动。我现在做的能画出曲线和圆点,但移动滚动条的时候整个曲线上都是圆点了,所以想在圆点移动到下个位置时要删除上一个圆点,但又不想连曲线都删掉。
其实我的思路是把每次画好的圆点付给一个变量,在下次画圆点的时候删除它,但是我不知道能不能把它付给一个变量,和如何付。 展开
其实我的思路是把每次画好的圆点付给一个变量,在下次画圆点的时候删除它,但是我不知道能不能把它付给一个变量,和如何付。 展开
3个回答
展开全部
你在原来的地方在画一个一样大小的圆,只是把颜色改成界面的颜色,这样就看不出原来的圆了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-05-06
展开全部
Dim t As Byte, s As Byte, c As Byte
Private Sub Command1_Click()
t = 1
If Form1.ForeColor = Form1.BackColor Then ForeColor = QBColor(c)
If Form1.DrawWidth = 12 Then Form1.DrawWidth = s
End Sub
Private Sub Command2_Click()
Form1.DrawWidth = 12
t = 2
End Sub
Private Sub Command3_Click()
Cls
Form1.ForeColor = vbBlack
Form1.DrawWidth = 1
t = 1
End Sub
Private Sub Form_Load()
Dim i%
For i = 0 To 15
Picture1(i).BackColor = QBColor(i)
Next i
Form1.ForeColor = vbBlack
t = 1
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
CurrentX = X: CurrentY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 And t = 1 Then Line -(X, Y)
If Button = 1 And t = 2 Then Form1.ForeColor = Form1.BackColor: Form1.MousePointer = 4: Line -(X, Y)
End Sub
Private Sub Picture1_Click(Index As Integer)
Form1.ForeColor = Picture1(Index).BackColor
c = Index
End Sub
Private Sub Picture2_Click()
Form1.DrawWidth = 1: s = 1
End Sub
Private Sub Picture3_Click()
Form1.DrawWidth = 2: s = 2
End Sub
Private Sub Picture4_Click()
Form1.DrawWidth = 4: s = 4
End Sub
Private Sub Picture5_Click()
Form1.DrawWidth = 8: s = 8
End Sub
另外,团IDC网上有许多产品团购,便宜有口碑
Private Sub Command1_Click()
t = 1
If Form1.ForeColor = Form1.BackColor Then ForeColor = QBColor(c)
If Form1.DrawWidth = 12 Then Form1.DrawWidth = s
End Sub
Private Sub Command2_Click()
Form1.DrawWidth = 12
t = 2
End Sub
Private Sub Command3_Click()
Cls
Form1.ForeColor = vbBlack
Form1.DrawWidth = 1
t = 1
End Sub
Private Sub Form_Load()
Dim i%
For i = 0 To 15
Picture1(i).BackColor = QBColor(i)
Next i
Form1.ForeColor = vbBlack
t = 1
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
CurrentX = X: CurrentY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 And t = 1 Then Line -(X, Y)
If Button = 1 And t = 2 Then Form1.ForeColor = Form1.BackColor: Form1.MousePointer = 4: Line -(X, Y)
End Sub
Private Sub Picture1_Click(Index As Integer)
Form1.ForeColor = Picture1(Index).BackColor
c = Index
End Sub
Private Sub Picture2_Click()
Form1.DrawWidth = 1: s = 1
End Sub
Private Sub Picture3_Click()
Form1.DrawWidth = 2: s = 2
End Sub
Private Sub Picture4_Click()
Form1.DrawWidth = 4: s = 4
End Sub
Private Sub Picture5_Click()
Form1.DrawWidth = 8: s = 8
End Sub
另外,团IDC网上有许多产品团购,便宜有口碑
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
TRY曲线和圆点都重新绘制?
试着用SHPAE控件实现。
试着用SHPAE控件实现。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询