Activity Background image?

techknight

Well-Known Member
Licensed User
Longtime User
How do you set an activity background image? Say i have a JPG image and i want it to load as an activity background.

I did it manually through the layout editor using an imageview, but the problem is i want to have a background before the layout loads, so when i use the slide itll keep the same background without moving.
 

techknight

Well-Known Member
Licensed User
Longtime User
yea, i just figured it out. Done it a slightly different way though.

Plus i needed to turn on transparency on both my layouts plus set the level to 0 instead of default 255
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you

Margret,

I guess techknight forgot to thank u in all the excitement of finding a solution. If he allows me, I will thank you - it took me a while to unravel this issue - and you had the answer all along...
 
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
Is there any way to set the activity background to an image file at Compile time rather than run time. I recall in VB6 you could add a background image to a form and that background was saved as part of the compiled EXE eliminating the need to have to load a background image at run-time.
Just wondering if that capability exists in B4A.
Thanks!
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
You can create a new Layout file in the designer or modify one you already have. In the designer select Activity, then change the ColorDrawable to BitmapDrawable. In the right pane, click Add and select your file. Next select ImageFile and select the image you just added. See Attached:

layo.jpg
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
You can create a new Layout file in the designer or modify one you already have. In the designer select Activity, then change the ColorDrawable to BitmapDrawable. In the right pane, click Add and select your file. Next select ImageFile and select the image you just added. See Attached:

layo.jpg
Thanks Margret,

So simple when you know how. I wish I had found this post 3 days ago.

Regards Roger
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
Margret,

I know this is an old thread but, ... I now find I need the user to be able to change the background image.
This means changing the image programatically from the main acttivity. Any clues how I can achieve this?

Regards Roger


Thanks Margret,

Writing the question focused the brains cells and the answer came to me. Thanks for listening

Roger
 
Last edited:
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Use one of the dialog class.. I recall one has a chose file dialog... then set the background to the user's chosen file
 
Upvote 0
Top