P PharCyDeD Active Member Licensed User Longtime User Feb 8, 2012 #1 How would you go about comparing two ImageView backgrounds? For instance, I tried: Code: Copy If ImageView1.Bitmap = ImageView2.Bitmap Then Label1.Text = "Yes" End If and Code: Copy If ImageView1.Background = ImageView2.Background Then Label1.Text = "Yes" End If I am not getting any results with this...any help? :BangHead: I am using: Code: Copy ImageView1.SetBackgroundImage(LoadBitmap(File.DirAssets, "Krazy_Triangles_[48]_021.png")) To set the backgrounds if that helps. Last edited: Feb 9, 2012
How would you go about comparing two ImageView backgrounds? For instance, I tried: Code: Copy If ImageView1.Bitmap = ImageView2.Bitmap Then Label1.Text = "Yes" End If and Code: Copy If ImageView1.Background = ImageView2.Background Then Label1.Text = "Yes" End If I am not getting any results with this...any help? :BangHead: I am using: Code: Copy ImageView1.SetBackgroundImage(LoadBitmap(File.DirAssets, "Krazy_Triangles_[48]_021.png")) To set the backgrounds if that helps.
stevel05 Expert Licensed User Longtime User Feb 9, 2012 #2 The bitmaps will be two separate objects, even if the contents are the same (the same image). Comparing ImageView1.Bitmap = ImageView2.Bitmap is actually comparing the pointers to the objects so will always be different. The Background and bitmap are different objects as well (I think). The easiest way would probably be to record the filename loaded in the ImageViews Tag Property at the time of loading then compare that. Last edited: Feb 9, 2012 Upvote 0
The bitmaps will be two separate objects, even if the contents are the same (the same image). Comparing ImageView1.Bitmap = ImageView2.Bitmap is actually comparing the pointers to the objects so will always be different. The Background and bitmap are different objects as well (I think). The easiest way would probably be to record the filename loaded in the ImageViews Tag Property at the time of loading then compare that.
P PharCyDeD Active Member Licensed User Longtime User Feb 9, 2012 #3 Ahh thank you so much. Storing data in the tags and comparing it does the trick. :sign0188: Upvote 0