Android Question Bitmap file compare doesn't work

Hamo

Member
Licensed User
Longtime User
I am trying to toggle the bitmap image of a view. I need to check which bitmap is currently loaded into the view and switch to the other bitmap when the view is clicked. image1.jpg is already loaded and displayed but the if statement is failing. Is there another way of doing ths ? Thanks for any help

Sub ImageView_Click
Dim bm As Bitmap
bm = LoadBitmap(File.DirAssets,"image1.jpg")
If ImageView.Bitmap = bm Then
ImageView.Bitmap = LoadBitmap(File.DirAssets,"image2.jpg")
Else
ImageView.Bitmap = LoadBitmap(File.DirAssets,"image1.jpg")
End If
End Sub

Hamo
 

Hamo

Member
Licensed User
Longtime User
Just figured I can get round this by using the Tag field of the imageview.
Hamo
 
Upvote 0
Top