B4J Question TextArea Background Image

a n g l o

Active Member
Licensed User
Longtime User
hi, no code at all :
starting a new b4j ui project, opening the designer, adding some jpg,bmp,png files, adding a TextArea, selecting Drawable Bitmap, selecting any one of the files added.
running the program. the TextArea does not show the background image.
tried the alpha level, tried images that are bigger, smaller then the TextArea. tried doing it by code (CSSutils) - nothing.
with TextField it's okay. but i'm intrested in TextArea.
Thanks for any advice.
 

TILogistic

Expert
Licensed User
Longtime User
TextArea.Style = $"-fx-background-image: url(${File.GetUri(File.DirAssets, "img.jpg")})"$

1617828490910.png
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
see:

B4X:
TextArea.Style = $"
                -fx-background-image: url(${File.GetUri(File.DirAssets, "img.jpg")});
                -fx-background-repeat: stretch;
                -fx-background-size: 100% 100%;
                -fx-background-position: center center;
                -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.9), 10, 0, 0, 0);
                -fx-background-color: transparent;
                "$

1617869458559.png
 
Last edited:
Upvote 0

a n g l o

Active Member
Licensed User
Longtime User
oparra, thanks !
i've tried and not satisfied. it's a lot of numbers and sizes to play with.

my question was about the simple RAD option in the designer.

Thanks
 
Upvote 1

TILogistic

Expert
Licensed User
Longtime User
i've tried and not satisfied. it's a lot of numbers and sizes to play with.

I don't understand, if you just have to add a style file for the text areas or just code for a particular area text.

Regards.
 
Upvote 0

a n g l o

Active Member
Licensed User
Longtime User
oparra thank you, THIS is the properties for TextArea :

Capture.jpg


what's in RED - Does not work (for me. i expect that the TextArea background will be the image (filled or tiled as i select), and that the text will be displayed on it). now :

1. am i doing /expecting something wrong ? if yes - what ?
2. is it a bug in b4j ?
3. is it a mistake and this property should not be there ?
4. any other explanation ?

I'm here for RAD and i see a RAD option here. please, wait with me for the answer.
Thank you
 
Last edited:
Upvote 0

a n g l o

Active Member
Licensed User
Longtime User
test - add same file to TextField and to TextArea :

result :
Capture.jpg


are you sure that your test was not with TextField ?
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
just add the image in the design.

and the style file does the work of laying out the textarea type field

Regards.
 
Upvote 0

a n g l o

Active Member
Licensed User
Longtime User
oparra, from your code, i deleted the line :
B4X:
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "Style.css"))
and then - your result is exactly as my result.

so i'm back to square 1 : the designer works fine with TextField, not working with TextArea.
1. am i doing /expecting something wrong ? if yes - what ?
2. is it a bug in b4j ?
3. is it a mistake and this property should not be there ?
4. any other explanation ?

I'm here for RAD and i see a RAD option here. please, wait with me for the answer. (getting a Style.css file from you is not a REAL RAD....THANK YOU:))
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
I'm here for RAD and i see a RAD option here. please, wait with me for the answer. (getting a Style.css file from you is not a REAL RAD....THANK YOU:))

In Java I have always had to format TextArea and other objects.

If you know of a RAD that does, can you tell me which one?
 
Upvote 0
Top