iOS Question Geting bitmap of imageview

tufanv

Expert
Licensed User
Longtime User
Hello,

I am using several imageviews in my app. I have a problem.i set imageview1 's bitmap as :

imageview1.bitmap = LoadBitmap(File.DirAssets, "gri.png" )

when i try to get the bitmap with log(imageview1.bitmap) i get something like :
<B4IBitmap: <UIImage: 0x17ec86b0>, {100, 100}>

what i try to make is i want to check if imageview1.bitmap = gri.png then do something but i cant do it .

Any ideas ? Thank you
 

strat

Active Member
Licensed User
Longtime User
Tufan bu kısım genel forum olduğundan ingilizce yazıyorum. Sadece bir fikir.

Use an array like
B4X:
Dim imagenames(50) As String

Assign imagenames to array :
B4X:
imagenames(1)="gri.png"
imagenames(2)="red.png"
....

To check imagename to any picture use this :
B4X:
If imagenames(1)="gri.png" Then

imagename(1) cheks for name of imageview1.bitmap, imagenames(2) checks for imageview2.bitmap etc.
 
Upvote 0

imbault

Well-Known Member
Licensed User
Longtime User
You can put your image file name in ImageView.tag then use the tag property to check your file name, like :

B4X:
imageview1.Bitmap = LoadBitmap(File.DirAssets, "gri.png" )
imageview1.Tag = "gri.png"

log(imageview1.Tag )
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Tufan bu kısım genel forum olduğundan ingilizce yazıyorum. Sadece bir fikir.

Use an array like
B4X:
Dim imagenames(50) As String

Assign imagenames to array :
B4X:
imagenames(1)="gri.png"
imagenames(2)="red.png"
....

To check imagename to any picture use this :
B4X:
If imagenames(1)="gri.png" Then

imagename(1) cheks for name of imageview1.bitmap, imagenames(2) checks for imageview2.bitmap etc.
Hocam tesekkur ederim:)
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
You can put your image file name in ImageView.tag then use the tag property to check your file name, like :

B4X:
imageview1.Bitmap = LoadBitmap(File.DirAssets, "gri.png" )
imageview1.Tag = "gri.png"

log(imageview1.Tag )
Thank you
 
Upvote 0
Top