-1
其基本颜色选择器 现在当如果阶梯指定的颜色钓到它播放歌曲 什么希望的是,当一旦这种颜色再次挑选的歌曲应该发挥再次 我试着使用线程;但它不工作提前 感谢..我要重新启动定时器
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Dim BMP As New Drawing.Bitmap(1, 1)
Dim GFX As System.Drawing.Graphics =
System.Drawing.Graphics.FromImage(BMP)
GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y), _
New Drawing.Point(0, 0), BMP.Size)
Dim Pixel As Drawing.Color = BMP.GetPixel(0, 0)
CPpanel.BackColor = Pixel
redtxt.Text = Pixel.R
greentxt.Text = Pixel.G
bluetxt.Text = Pixel.B
If redtxt.Text = 0 Then
If greentxt.Text = 173 Then
If bluetxt.Text = 73 Then
AxWindowsMediaPlayer1.URL = "song.mp3"
Timer1.Stop()
End If
End If
Else
Timer1.Start()
End If
End Sub
谢谢。但是我也在if else阶段之后尝试了'timer1.start()'。这就是整个代码。我只想在捕捉RGB值中指定的颜色后重新启动计时器。 –
@NirmalPatel:你为什么要停止计时器_at all_如果你想继续? –
如果我不停止在if条件下的计时器,那么它会播放歌曲。那是为什么...... @visual vincent –