Android Question Fill button or panel with loaded image

appie21

Active Member
Licensed User
Longtime User
Hello

I try to Fill a image (PNG ) to a button or pannel. I can load it but not FILL it
I have tried 2 things


It loaded the image on the button and panel but it is not Filled


img to panel:
Private BtnBear,PnlPlayAnimals As B4XView
'   PnlPlayAnimals.SetBitmap (LoadBitmap(File.DirAssets, "MouseNF.png"))
 ' PnlPlayAnimals.SetBitmap(Gravity.FILL)
'    Dim bd As BitmapDrawable
'    bd.Initialize(LoadBitmap(File.DirAssets, "MouseNF.png"))
'    bd.Gravity = Gravity.FILL
'    PnlPlayAnimals.SetBitmap(bd)

BtnBear.SetBitmap(LoadBitmap(File.DirAssets, "MouseNF.png"))
if i run

PnlPlayAnimals.SetBitmap(Gravity.FILL)
src\b4a\example\b4xmainpage.java:92: error: incompatible types: int cannot be converted to Bitmap
_pnlplayanimals.SetBitmap((android.graphics.Bitmap)(__c.Gravity.FILL));
^
1 error
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…