LucaMs Expert Licensed User Longtime User Jul 18, 2019 #1 How to get a Paint (?) if you have an int variable set using xui.PaintOrColorToColor?
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2019 #2 You don't want to get a paint when working with XUI. Only ints. If you do want to get a paint for some strange reason then: B4X: Dim p as Paint = fx.Colors.From32Bit(0xffff0000) Upvote 0
You don't want to get a paint when working with XUI. Only ints. If you do want to get a paint for some strange reason then: B4X: Dim p as Paint = fx.Colors.From32Bit(0xffff0000)
LucaMs Expert Licensed User Longtime User Jul 18, 2019 #3 Erel said: for some strange reason Click to expand... The reason is very clear: I'm a bit confused Actually what I'm doing is saving a map of preferences (using B4XSerializator) and one of them is the MainForm back color, which is a Paint object. B4X: mMainFormColor = mmapPref.GetDefault("MainFormColor", xui.Color_Green) At this point I don't know how to set the MainForm.BackColor to mMainFormColor. Upvote 0
Erel said: for some strange reason Click to expand... The reason is very clear: I'm a bit confused Actually what I'm doing is saving a map of preferences (using B4XSerializator) and one of them is the MainForm back color, which is a Paint object. B4X: mMainFormColor = mmapPref.GetDefault("MainFormColor", xui.Color_Green) At this point I don't know how to set the MainForm.BackColor to mMainFormColor.
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2019 #4 B4X: IntColor = fx.Colors.To32Bit(MainForm.BackColor) Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2019 #5 I'm confused. This code is also correct: B4X: IntColor = XUI.PaintOrColorToColor(MainForm.BackColor) Upvote 0
LucaMs Expert Licensed User Longtime User Jul 18, 2019 #6 But I have to set the MainForm.BackColor, not get it. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2019 #7 B4X: Form.BackColor = fx.Colors.From32Bit(mmapPref.GetDefault("MainFormColor", xui.Color_Green)) Upvote 0
LucaMs Expert Licensed User Longtime User Jul 18, 2019 #8 I was thinking to that From32bit... about how to convert my Int to... 32bit Upvote 0
LucaMs Expert Licensed User Longtime User Jul 18, 2019 #9 (here it is nearly a different question... I don't know if I should open a new thread). I tried directly: MainForm.BackColor = fx.Colors.From32Bit(xui.Color_Blue) but this has no effects. Strangely, BackColor requires a Paint object and From32Bit returns a javafx.scene.paint.Color, which is accepted but, as I said, the MainForm back color does not change. Upvote 0
(here it is nearly a different question... I don't know if I should open a new thread). I tried directly: MainForm.BackColor = fx.Colors.From32Bit(xui.Color_Blue) but this has no effects. Strangely, BackColor requires a Paint object and From32Bit returns a javafx.scene.paint.Color, which is accepted but, as I said, the MainForm back color does not change.
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2019 #10 The color is represented as 4 bytes (ARGB) = 32 bits. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2019 #11 Works fine here: B4X: MainForm.BackColor = fx.Colors.From32Bit(xui.Color_Blue) Dim x As B4XView = MainForm.RootPane x.Color = xui.Color_Transparent The real question is why do you need to set BackColor. Set MainForm.RootPane color instead. Upvote 0
Works fine here: B4X: MainForm.BackColor = fx.Colors.From32Bit(xui.Color_Blue) Dim x As B4XView = MainForm.RootPane x.Color = xui.Color_Transparent The real question is why do you need to set BackColor. Set MainForm.RootPane color instead.
LucaMs Expert Licensed User Longtime User Jul 18, 2019 #12 Erel said: The real question is why do you need to set BackColor. Set MainForm.RootPane color instead. Click to expand... Because I "searched" a property to set the RootPane color but I didn't find it (right now I found "Style", I think I should use it). Upvote 0
Erel said: The real question is why do you need to set BackColor. Set MainForm.RootPane color instead. Click to expand... Because I "searched" a property to set the RootPane color but I didn't find it (right now I found "Style", I think I should use it).
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2019 #13 LucaMs said: right now I found "Style", I think I should use it Click to expand... Don't. Use B4XView as I did in the post above. Upvote 0
LucaMs said: right now I found "Style", I think I should use it Click to expand... Don't. Use B4XView as I did in the post above.
LucaMs Expert Licensed User Longtime User Jul 18, 2019 #14 Erel said: Don't. Use B4XView as I did in the post above. Click to expand... Done (although I have not understood its functioning well ) Upvote 0
Erel said: Don't. Use B4XView as I did in the post above. Click to expand... Done (although I have not understood its functioning well )
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2019 #15 Very simple. B4X: Dim x As B4XView = AnyViewType 'work with x Upvote 0
LucaMs Expert Licensed User Longtime User Jul 18, 2019 #16 Erel said: Very simple. B4X: Dim x As B4XView = AnyViewType 'work with x Click to expand... Yes but this is the part I don't understand: Erel said: x.Color = xui.Color_Transparent Click to expand... Last edited: Jul 18, 2019 Upvote 0
Erel said: Very simple. B4X: Dim x As B4XView = AnyViewType 'work with x Click to expand... Yes but this is the part I don't understand: Erel said: x.Color = xui.Color_Transparent Click to expand...
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2019 #17 I wanted to test whether the BackColor works. You need to set the root pane color to transparent in order to see the back color. Upvote 0
I wanted to test whether the BackColor works. You need to set the root pane color to transparent in order to see the back color.