Help to compare pictures in a PictureBox

shrosario

Newcomer
Joined
Oct 9, 2002
Messages
8
I need help to compare to different picturebox controls for the same image!

Ex. In vb6

If pic1.Picture = pic2.Picture Then

But visual basic.net underlines it as a error.

Thanks for your help in advance
 
I don't think there is a way to do this easily (without manually comparing
the pixels), because although the two pictures might look the same,
they are two different objects. The '=' operator is not defined for
Images, and the 'Is' operator will not do what you need in this case
(because they are two seperate objects, not two seperate references
to the same object).

If you tell me what you are trying to do in this program, I might be able
to help you come up with a better way than comparing the pictures
in the picturebox.
 
How are you loading these pictures? Are you loading them from files?
If you are, you could store the filenames of both pictures in variables
and compare them that way.
 
Back
Top