1
    var img1 = (pictureBox1.Image = Properties.Resources.dynamite);
    var img2 = (pictureBox2.Image = Properties.Resources.apple);
 if (img1 != img2)
                    {
                        MessageBox.Show("ok");
                        pictureBox1.Image = Properties.Resources.empty;

                    }
                    else
                    {
                        MessageBox.Show("no");
                        Game_Over end = new Game_Over();
                        end.Show();
                    }

I want to create a simple game. If i hit a fruit the fruit picker is replace whit a empty picker and if you hit a dynamite to get game over

distrox
  • 11
  • 2

1 Answers1

1

Convert the images into byte arrays and then do the comparison of byte arrays.

Bytearray1.SequenceEqual( bytearray2 ) can be true or false.

Sanish Joseph
  • 2,140
  • 3
  • 15
  • 28