B4J Question reset label background image

giggetto71

Active Member
Licensed User
Longtime User
Hi,
I am successfully using CSS to set the background image of a label.


B4X:
CSSUtils.SetBackgroundImage(labe1,File.DirAssets,"test.png")

I need to reset the background at runtime and I have tried:

B4X:
CSSUtils.SetBackgroundImage(label1,File.DirAssets,"")

which removes the background but throws a warning in the log:

Waiting for debugger to connect...
Program started.

Sep 03, 2021 5:28:05 PM com.sun.javafx.css.StyleManager getCachedImage
WARNING: Error loading image: file:/C:/D/b4a_projects/B4J_Projects/testlabelimage/Files/

Is there a smarter way to do that?
thanks!
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
you can call the style property on any node
labe1.Style

check which key/value is the one you want to take out and use cssutils

CSSUtils.SetStyleProperty
 
Upvote 0
Top