用VB怎么读取一张图然后识别出图上唯一红点的位置并以坐标形式保存下来?图是摄像头拍出来的,VB代码或软

可以发我QQ 791830238@qq.com
2024-12-03 20:50:47
推荐回答(1个)
回答1:

先将图片加载 将鼠标指向红点 从text1里面获取这个点的颜色值
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Text = Picture1.Point(X, Y)
End Sub
然后
Private Sub Command2_Click()
For Y = 0 To Picture1.Height
For X = 0 To Picture1.Width
DoEvents
Me.Caption = X & ":" & Y
If Picture1.Point(X, Y) = 3355596 Then '‘‘其中3355596这个数值改为刚刚获取的值
MsgBox X & ":" & Y
find = True
Exit For
End If
Next X
If fine = ture Then
Exit For
End If
Next Y
End Sub