Click here to Skip to main content
15,883,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello
I have a question ,i put a image on button(EX:button1.image=image.fromfile("1.bmp"))
then i want to compare image on button with a specified image that if they equal then a method executed.
i dont khow code for compare image on button and specified image?

thanks:rose:
Posted

So your question has nothing to do with buttons, it is how do you compare two images ? To compare if they are the same file, do a pixel by pixel comparison. You can read my image processing articles for how to get the pixel data. If they are different files that show the same thing, is a very complex task indeed.
 
Share this answer
 
In my opinion it seems to be a complex task. You can read Image Processing articles

Good Luck
 
Share this answer
 
Rather you should be comparing with some text/code. You cannot compare an image, it requires image processing. Or else compare with the image names.

But the consequences are likely that the image name can be changed still containing the same image.

Recommendation: Use as associated identifier for the buttons to check equality.
 
Share this answer
 
Comments
Christian Graus 18-Jun-10 6:53am    
What do you mean 'you cannot compare an image' ? Of course you can.
GPUToaster™ 20-Jun-10 1:37am    
Thats what i meant over here...You directly cannot COMPARE two IMAGES("You cannot compare an image, IT REQUIRES IMAGE PROCESSING. Or else compare with the image names.").
Toli Cuturicu 21-Jun-10 4:43am    
Reason for my vote of 1
not true

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