Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

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.

  • *Experts*
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...