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
Featured Replies
  • 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. Read More

  • 1
    __avd 1,826   6 Years Ago

    +1 Momerath, well said. Arturo32, Take a look at [URL="http://www.c-sharpcorner.com/UploadFile/prathore/ImageComparison01022009050404AM/ImageComparison.aspx"]Image comparison[/URL] article. Read More

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.