I have added the images files to FileManager tab, and my code is:
Thanks a lot.
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private HSV_TOP_BAR As HorizontalScrollView
Private button1 As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("mainLayout")
button1.Initialize("button1")
button1.Color=Colors.ARGB(255,0,255,0) 'worked well
'button1.Bitmap=LoadBitmapSample(File.DirAssets,"move_left.png",128,128) '<-- not work!
'button1.Bitmap=LoadBitmap(File.DirAssets,"move_left.png") '<-- not work!
Dim bmp As Bitmap
bmp=LoadBitmap(File.DirAssets,"move_left.png")
Log(bmp) 'Load success.
button1.SetBackgroundImage(bmp) '<-- not work
HSV_TOP_BAR.Panel.AddView(button1,2,2,100%x/5,100%y)
End Sub
Thanks a lot.