Android Question How can I detect image under a transparent panel and its color distribution?

Mashiane

Expert
Licensed User
Longtime User
Hi

I have a transparent black border panel on top of an imageview. I want to detect the area of the imageview the panel is on top of the detect of that part of the image is 80% composed of dark colors. If it is I want to change the border color of the panel to white so that the panel is visible.

i.e. for darker image parts inside the panel, change transparent panel border to white and if that part of the image is white the transparent panel border should be black.

Any advice please?

ps: I have attached the respective images herein for more clarity.
 

Attachments

  • perfect.png
    perfect.png
    62.1 KB · Views: 173
  • notsoperfect.png
    notsoperfect.png
    69.6 KB · Views: 169

JordiCP

Expert
Licensed User
Longtime User
You could better draw a double border (white on the outer side and black in the inner) so that it will contrast in most cases

Also, I would do something similar for the text: First draw the text in white and then, from the same position plus 1dip right and 1dip up, draw the same text in black color
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
You could better draw a double border (white on the outer side and black in the inner) so that it will contrast in most cases

Also, I would do something similar for the text: First draw the text in white and then, from the same position plus 1dip right and 1dip up, draw the same text in black color
Thanks, you gave me an idea and search on "shadow" gave me this post, for the label on my side, its perfect! https://www.b4x.com/android/forum/threads/add-shadow-to-a-label-text.30395/#post-176498, now for the panel.
 
Upvote 0
Top