tufanv Expert Licensed User Longtime User Nov 25, 2016 #1 Hello in b4i i can use : Code: Copy If paneldoviz(i-1).Color = Colors.RGB(64,64,64) Then to read the backgroudn color of a panel and do things according to it. but in b4a it says it is writeonly. I found an old post about it and it says we have to initialize canvas to the panel to use canvas.bitmap.gitpixel But when i use : cv(i).Initialize(pdoviz(i)) i get : java.lang.NullPointerException for the initialize. How can i solve this and read panels background color ? TY
Hello in b4i i can use : Code: Copy If paneldoviz(i-1).Color = Colors.RGB(64,64,64) Then to read the backgroudn color of a panel and do things according to it. but in b4a it says it is writeonly. I found an old post about it and it says we have to initialize canvas to the panel to use canvas.bitmap.gitpixel But when i use : cv(i).Initialize(pdoviz(i)) i get : java.lang.NullPointerException for the initialize. How can i solve this and read panels background color ? TY
S strat Active Member Licensed User Longtime User Nov 25, 2016 #2 At which line do you get this error? It may be a different problem. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 27, 2016 #3 See this post: https://www.b4x.com/android/forum/threads/wish-get-color-of-a-label.23108/#post-134379 Upvote 0
See this post: https://www.b4x.com/android/forum/threads/wish-get-color-of-a-label.23108/#post-134379