shrosario Posted February 18, 2003 Posted February 18, 2003 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 Quote
*Experts* Volte Posted February 18, 2003 *Experts* Posted February 18, 2003 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. Quote
shrosario Posted February 18, 2003 Author Posted February 18, 2003 I'm trying to compare the images in to seperate pictureboxes to see if they are the same picture. Quote
*Experts* Volte Posted February 18, 2003 *Experts* Posted February 18, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.