Can I use just a tag to change an imageview??

thughesimsuk

Member
Licensed User
Longtime User
I have loads of imageviews on my project that have unique tags. My question is, can I change the bitmap of an image for example, using just tag somehow?

i.e. image1.tag("image1").bitmap = newbitmap

I currently use a sender.bitmap to change an image that has been clicked on but I also need to update other images that have not been clicked on, if that makes sense.

Thanks in advance!

Tom
 

Harris

Expert
Licensed User
Longtime User
From the beginners guide:

Tag: This is a place holder which can used to store additional data. Tag can simply be text but can also be any other kind of object.

I would be careful with the size of bitmap.... (providing this is true).
 
Upvote 0

thughesimsuk

Member
Licensed User
Longtime User
From the beginners guide:

Tag: This is a place holder which can used to store additional data. Tag can simply be text but can also be any other kind of object.

I would be careful with the size of bitmap.... (providing this is true).


Would you be able to explain 'any other kind of object'? So would it be possible for me to target a view with a certain tag? i.e. If i had an image with a tag of 'Zebra' change that image using the tag?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Are these ImageViews independant or are those in a ScrollView ?
Either these are known by their name and you can attribute a new bitmap with image1.Bitmap = newBitmap.
If they are in a ScrollView you can get them with ScrollView1.Panel.GetView(i). i depends on the number of views per row and the index of the view in the row. From your example here and for img_blank_yes i = row * 4 + 3

Best regards.
 
Upvote 0

thughesimsuk

Member
Licensed User
Longtime User
Thanks

As ever Klaus you came through with the goods! Thanks! Once I figured out what index numbers the views were being assigned with the ScrollView1.panel.GetView(i) worked a treat.
 
Upvote 0
Top