Android Question Floating windows class backgroud

juniorteacher

Member
Licensed User
Longtime User
how to set background in floating windows class?

B4X:
Sub Globals
dim drag1 As ClsFloatingWindow
dim panel1 as panel
end sub

Sub Activity_Create(FirstTime As Boolean)
  Activity.LoadLayout("game3")
   drag1.Initialize(Panel1, 5%x, 40%y, 30%x, 10%y, Me)
   drag1.EnableTitleBar(False)
   drag1.SetBackground(LoadBitmap(File.DirAssets,"g3 soal1 0.png")) ' getting error in here
end sub
 

LucaMs

Expert
Licensed User
Longtime User
Try so:
B4X:
Sub Activity_Create(FirstTime As Boolean)
  Activity.LoadLayout("game3")
   drag1.Initialize(Panel1, 5%x, 40%y, 30%x, 10%y, Me)
   drag1.EnableTitleBar(False)
   Dim BD As BitmapDrawable = LoadBitmap(File.DirAssets,"g3 soal1 0.png")
   drag1.SetBackground(BD) ' getting error in here
end sub
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
  Activity.LoadLayout("game3")
   drag1.Initialize(Panel1, 5%x, 40%y, 30%x, 10%y, Me)
   drag1.EnableTitleBar(False)
   Dim BD As BitmapDrawable
   BD.Initialize(LoadBitmap(File.DirAssets, "g3 soal1 0.png"))
   drag1.SetBackground(BD) ' getting error in here
end sub
 
Upvote 0
Top