Android Question Getting Panels color

tufanv

Expert
Licensed User
Longtime User
Hello

I made a forum search but couldnt find a info. Color event is only for write i cant read the color of a panel. How can i get the background color of a panel ?

ty
 

tufanv

Expert
Licensed User
Longtime User
Define a canvas to the panel.
Canvas.bitmap.getpixel.....
Thank you for the answer. IS there any forum post to define a canvas to a panel or can you show a little example if possible ? I dont know what is to define a canvas to a panel

ty
 
Upvote 0

derez

Expert
Licensed User
Longtime User
Press b4a in this page menu above, select documentation index and then roll down to types and select canvas.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Press b4a in this page menu above, select documentation index and then roll down to types and select canvas.
Yep, I did the search. I have initialized canvas to each panel. But my problem is when i draw color to each canvas i lose the borders of the panel. It draws on everything. How can i keep the borders
 
Upvote 0

derez

Expert
Licensed User
Longtime User
Initializing the canvas to the panel does not draw on it, you can get the color of any pixel without changing the bitmap.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Initializing the canvas to the panel does not draw on it, you can get the color of any pixel without changing the bitmap.
ah got it now ty very much . ,I was drawing color on the panel. that was hiding the borders !
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
I have one more question. If i execute panel2.color = colors.white
it also clears the borders altough they are set at designer. Why doesnt it just change the color of the panel but also clears the borders ?
 
Upvote 0

derez

Expert
Licensed User
Longtime User
I guess that the designer is doing a series of operations like draw a color rectangle in the border's color, then a smaller rectangle in the selected panel color etc.
When you draw it creates a new bitmap.
 
Upvote 0
Top