Click here to Skip to main content
15,886,851 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am using Visual Studio 2008. I have an issue I can't wrap my mind aroung on how to solve it and I can't find a solution anywhere.

I have 15 picture boxes on a form, but I want to know how to compare the images in the picture boxes to see if they are the same picture.

The pictures are loaded from my projects resources file, and according to research done on articles on the internet, I cannot use the pictureBox1.imageLocation, because the images are lying in the resources file.

I have tried to compare the images byte by byte, but this is not very efficient.

Is there any other way to solve this?
Posted
Updated 15-Dec-10 23:10pm
v2
Comments
Manfred Rudolf Bihy 16-Dec-10 5:11am    
Edited for spelling and grammar.
Manfred Rudolf Bihy 16-Dec-10 5:16am    
How are the pictures loaded into the picture boxes? Are you doing this in your own code? Then it shouldn't be to hard to track which image was placed into which picture box.
Andrew797 16-Dec-10 6:03am    
firstly i load the images out of the resources file into an Image array. then in the buttons click event i declared a random class which chooses a random picture out of the array and places it in an individual picturebox. this process happens for every picturebox on my form.

1 solution

See here[^].

Honestly speaking, I dont know if this would offer any more efficieny than your code though - you could try it out.
 
Share this answer
 
v2
Comments
Manfred Rudolf Bihy 16-Dec-10 5:14am    
My first thought was also to build a hash MD5 or whatever, but I totally agree with you that this is no more efficient than comparing them byte by byte. Take a 5 anyway :)
Abhinav S 16-Dec-10 5:27am    
Thanks for the 5. Sorry could not help much with this - at least the code would look cleaner. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900