vb中如何获得picture控件中点的坐标
picture控件左右间距5760,每隔0.1取一个点,存到一个数组里,本人新手,谢谢PrivateSubPicture1_MouseDown(ButtonAsInteg...
picture控件左右间距5760,每隔0.1取一个点,存到一个数组里,本人新手,谢谢
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim k As Long
k = 0
If Option8.Value = True Then(按钮是确定要连线)
Button = 1
begy = Y
b = 1
e = Fix(X * 10)
Picture1.CurrentX = X
begx = Picture1.CurrentX
Picture1.CurrentY = Y
While k < e
byt(k) = 0
k = k + 1
Wend
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim a As Long
Dim b As Integer
Dim g As Double
Dim t As Integer
If Button = 1 And Option8.Value = True Then
Picture1.Line -(X, Y)
g = X - begx
If g > 0.1 * b Then(这个为什么不可以等于,等于好像取不到点)
byt1(e) = (8000 - Fix(Y)) / 20
Picture1.Print byt1(e)
e = e + 1
b = b + 1
End If
End If
End Sub 展开
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim k As Long
k = 0
If Option8.Value = True Then(按钮是确定要连线)
Button = 1
begy = Y
b = 1
e = Fix(X * 10)
Picture1.CurrentX = X
begx = Picture1.CurrentX
Picture1.CurrentY = Y
While k < e
byt(k) = 0
k = k + 1
Wend
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim a As Long
Dim b As Integer
Dim g As Double
Dim t As Integer
If Button = 1 And Option8.Value = True Then
Picture1.Line -(X, Y)
g = X - begx
If g > 0.1 * b Then(这个为什么不可以等于,等于好像取不到点)
byt1(e) = (8000 - Fix(Y)) / 20
Picture1.Print byt1(e)
e = e + 1
b = b + 1
End If
End If
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询