mardi 14 avril 2015

Android ImageView Cropping Transparent Pixels [Bug]

I think I've officially found a bug, but I could not find anybody else having the same experience. It is odd because I've ran into this hair-tearing bug several times on different projects.


It involves using png's with transparency in Android Studio. If the background of the png is transparent #00000000, Android will crop & zoom in on the image on some devices (4.0 ICS, 4.1 JB), and on other devices it will not show up at all (4.1 JB, or any TouchWiz). It is not limited to any specific image. If I go edit the image background to be #01000000 (rgba 0,0,0,0.0001) it will work fine.


I've used different image-editing programs to no avail. My ImageMagick command I normally use is convert a.png -transparent red -fuzz 5% b.png. Works fine everywhere, but has repeatedly caused problems on Android Studio. That's where I had to load up Gimp, Paint.NET, etc. to set it to #01000000, but then there's a discernable tint inside my image.


Has anybody else had this issue?


ANY input is appreciated, thanks


Aucun commentaire:

Enregistrer un commentaire