B4J Question B4XImageView: Backcolor and Border

Xela

Member
Licensed User
Salve
Come si cambia il colore dello sfondo in una B4XImageView?
Ho provato queste soluzioni che con altri oggetti funzionano:

imgLogo.mBackgroundColor = fx.Colors.ARGB(255,32,64,96)
imgLogo.mBase.SetColorAndBorder(fx.Colors.ARGB(255,32,64,96), 1, fx.Colors.ARGB(255,255,255,192), 0)
CSSUtils.SetBackgroundColor( imgLogo, fx.Colors.ARGB(255,32,64,96))

ma ottengo sempre l'errore:

java.lang.NumberFormatException: per la stringa di input: "0x1f856987"

Grazie per l'aiuto
 

LucaMs

Expert
Licensed User
Longtime User
Qui devi scrivere in inglese; eventualmente poni le domande nel forum italiano.

B4X:
B4XImageView1.mBackgroundColor = xui.Color_ARGB(255,32,64,96)
B4XImageView1.mBase.SetColorAndBorder(xui.Color_ARGB(255,32,64,96), 1, xui.Color_ARGB(255,255,255,192), 0)
 
Upvote 0

teddybear

Well-Known Member
Licensed User
imgLogo.mBase.SetColorAndBorder(fx.Colors.ARGB(255,32,64,96), 1, fx.Colors.ARGB(255,255,255,192), 0)

You are using an incorrect parameter type, try this:

B4X:
 imgLogo.mBase.SetColorAndBorder(xui.Color_ARGB(255,32,64,96), 1, xui.Color_ARGB(255,255,255,192), 0)
 
Upvote 0

Xela

Member
Licensed User
Qui devi scrivere in inglese; eventualmente poni le domande nel forum italiano.

B4X:
B4XImageView1.mBackgroundColor = xui.Color_ARGB(255,32,64,96)
B4XImageView1.mBase.SetColorAndBorder(xui.Color_ARGB(255,32,64,96), 1, xui.Color_ARGB(255,255,255,192), 0)
My goodness, you don't miss a single one.
I only realised I wasn't on the Italian forum after I had posted the question.
I'll be more careful.

Anyway, thank you for your reply.
Your help is always prompt and punctual.
 
Upvote 0
Top