Transparent PNG in imageview

nemethv

Member
Licensed User
Longtime User
Hi,

I'm trying to set an imageview to show a transparent png. The file's transparency is properly set. I'm also trying to change the imageview's background color to say grey.
This (setting it grey) works perfectly well until I actually call the png file (FavBtn.SetBackgroundImage(LoadBitmap(File.DirAssets, "btn_rating_star_off_normal.png"))) when the transparent parts turn white. How can I keep it grey?
Thanks
 

Informatix

Expert
Licensed User
Longtime User
Hi,

I'm trying to set an imageview to show a transparent png. The file's transparency is properly set. I'm also trying to change the imageview's background color to say grey.
This (setting it grey) works perfectly well until I actually call the png file (FavBtn.SetBackgroundImage(LoadBitmap(File.DirAssets, "btn_rating_star_off_normal.png"))) when the transparent parts turn white. How can I keep it grey?
Thanks

When you load a bitmap in an ImageView, you paint the background with this bitmap. If you want a grey background behind, you have two solutions:
- placing a gray panel behind;
- drawing the bitmap (Canvas.DrawBitmap) on the ImageView
 
Upvote 0

nemethv

Member
Licensed User
Longtime User
When you load a bitmap in an ImageView, you paint the background with this bitmap. If you want a grey background behind, you have two solutions:
- placing a gray panel behind;
- drawing the bitmap (Canvas.DrawBitmap) on the ImageView

Thanks!
 
Upvote 0
Top