Android Question Set semi transparency of a panel outside its contained image

Matteo Granatiero

Active Member
Licensed User
For the semi-transparency of the panel use:
B4X:
Dim cd As ColorDrawable
    cd.Initialize ( Colors.ARGB( 100, 0, 0, 0) , 5dip )
    Panel1.Background = cd

The problem is: if I load an image in the panel (which is smaller than the panel panel because I set Gravity.Center, how do I set the rest of the panel with semi-transparency without "coloring" the inside of the image?
I attach image to make the idea
 

Attachments

  • b4.png
    b4.png
    14.4 KB · Views: 513

Semen Matusovskiy

Well-Known Member
Licensed User
Final variant. Tested under API 24 only, but should work for any Android 4+.
Let me know, if you will find troubles.
 

Attachments

  • test.zip
    11.9 KB · Views: 291
Upvote 0
Top