giggetto71 Active Member Licensed User Longtime User Sep 3, 2021 #1 Hi, I am successfully using CSS to set the background image of a label. B4X: Copy CSSUtils.SetBackgroundImage(labe1,File.DirAssets,"test.png") I need to reset the background at runtime and I have tried: B4X: Copy 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!
Hi, I am successfully using CSS to set the background image of a label. B4X: Copy CSSUtils.SetBackgroundImage(labe1,File.DirAssets,"test.png") I need to reset the background at runtime and I have tried: B4X: Copy 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 Expert Licensed User Longtime User Sep 3, 2021 #2 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
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
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2021 #3 I would have used an ImageView or better, B4XImageView for this. You can put the label above it. Upvote 0