Background image

volvomann

Active Member
Licensed User
Longtime User
Hallo can i use a picture as bacground behind buttons anand labels. if yes how can i do that?
 
In the designer layout of your .bal file, select the button you want, scroll down to where is says Drawable. Change this to read Statelist Drawable, then under it, change ColorDrawable to BitmapDrawable. You will then see a location for the filename. Be sure to add your images to the layout file on the right hand side.
 
Upvote 0
I've got a label that I need to draw 1 of 2 different images to the background, depending on device orientation.
I tried putting this in the designer's script, but it doesn't compile:
label1.SetBackgroundImage("wave.bmp")
Any tips?
 
Upvote 0
Any error message you dont tell us?
 
Upvote 0
You should put the below line in your code after loadlayout, not in the designer script:
Code:
Label1.SetBackgroundImage(LoadBitmap(File.DirAssets,"wave.bmp"))
 
Upvote 0
Back
Top