Okay I tried something and it works but I'm not quite sure its exactly what you want. And I doubt you actually detect whether a certain image shown in the screen.
Anyway, here's what I tried.
I just created a simple interface with a Button and a Picturebox. An I also added a OpenFileDialog control to the form.
In the Click event of the Button it pops up the OpenFileDialog for the user to select an image from the computers HD. Below is the code.
Public Class Form1
Private Sub btnSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelect.Click
'stores the filename withthe path
Dim fileName As String
'sets the OpenFileDialog's path to Pictures folder
OpenFileDialog1.InitialDirectory = "Libraries\Pictures"
'gets the filename to the previously declared variable
fileName = OpenFileDialog1.FileName
TextBox1.Text = fileName
'loads the picture to the Picturebox
PictureBox1.Image = Image.FromFile(fileName)
'if the filename matches the filepath stored in teh program, it shows the messagebox
If fileName = "C:\Users\nK0de\Pictures\tumblr_luwduahtnt1qzdsqh.png" Then
MessageBox.Show("Hey, its that red haired girl's pic!")
Here's the output.
Since that filepath is stored in the program, the messagebox pops up. If its not stored, the messagebox won't show up. So you'll have to store the paths of all the images to check which one is showing in the Picturebox. You can use an ArrayList (ArrayList Class (System.Collections)) or a Generic List (List(T) Class (System.Collections.Generic)) to store them and use a Loop to check against whether they exist.
No. For eg. I have google picture saved and when i open google.com it does something, like msgbox.
But not to detect that is in picturebox.
only if it's on screen (not specified position OR certain picturebox).
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)
Me.BackColor = Pixel
I've got it from youtube!
To make It work u need timer.
But instead of getting color i have to get image( i know this is not thesame. I'm not noob!!).
What you want to do is image recognition, or computer vision, and it is far from trivial. I suggest abandoning that path unless you know what you are stepping into. Look here for an example: Image Recognition with Neural Networks .