0

It is possible to compare background images of a pictureBox?
This piece of code works?:

pictureBox8.BackgroundImage == pictureBox9.BackgroundImage

I ask bcause apparently, if used as this:

if(pictureBox8.BackgroundImage == pictureBox9.BackgroundImage)

the result of that IF sentence is always false

Edited by Arturo32: n/a

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Arturo32
2

For most objects the == operation just compares if they are referencing the same object, it doesn't do a 'deep compare'. You'll have to write your own method that compares the images.

0

For most objects the == operation just compares if they are referencing the same object, it doesn't do a 'deep compare'. You'll have to write your own method that compares the images.

+1 Momerath, well said. Arturo32, Take a look at Image comparison article.

Thank you Momerath, and thank you too adatapost for that article, you solve my doubt.
Thank you again

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.