Glide - image alpha

I think this is equally an images issue not just a Glide issue…

I have a status alert on a Glide screen. When the alarm isn’t active, I want the item to not be visible. I start with the image loaded from resources and have an Alpha of 0. Then, when the alarm is triggered, I set alpha to 255 and invalidate it, and the item is visible. Then when the alarm clears, I’d like it to disappear - but setting it’s Alpha to 0 again and invalidating it doesn’t seem to work. I could simply overwrite it with a “blank” bitmap, but I was expecting the Alpha to work - anyone with suggestions on what I am doing wrong?

That never worked for me either so I end up just drawing a filled rectangle with the current window background colour. Cheaper on memory than an empty bitmap.

1 Like

@ Brett - Depending on what your doing, I created a background, then would add in / remove individual Bitmaps (in the GIF format) that had the area around what I wanted to display set to a transparency layer. Similar to Dave’s solution, but able to use full pictures instead of drawn primitives…
I am aware of the bug with Gif’s, but have found a procedure that works around the issue, but because the work around uses a free online site to strip, Something (have some hunches, but once working never tried to figure it out exactly), out of the Gif file, was hesitant to simply post it, as I didn’t know what the rules are about linking 3rd party sites.

There’s also my animated GIF support in codeshare. You could use that to grab any frame at anytime you wish.

1 Like

it literally is an exclamation icon that I want to appear when there’s an error and disappear when the error clears. I think this is likely to come up frequently in my use case so a swap of the bitmap vs a repaint of the screen may have a significant performance difference so I’ll test them out and see what one works best.

There’s really no issue posting 3rd party links if there’s a reason to - it’s not spam, and if it means a netmf behaviour is understood in a different light it can only benefit the community in my view - so post away.

overkill, but I like :slight_smile: