Android Question Getting Panels color

tufanv

Expert
Licensed 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
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
 

derez

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

tufanv

Expert
Licensed 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
 

derez

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

tufanv

Expert
Licensed 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 !
 

tufanv

Expert
Licensed 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 ?
 

derez

Expert
Licensed 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.
 
Top