Android Question Panel with cut out window

MoraviaVenus

Member
Licensed User
Longtime User
Hi all,

please, is it possible to create an element in B4A, which will behave like window? I mean e.g. combination of two red panels covering each other, where the intersection will be transparent (or let's say cut out).

Example is attached (over the picture with horse there is red panel with window).

Thank you.

horse.png
 

MoraviaVenus

Member
Licensed User
Longtime User
Good idea, but, unfortunately, I need to manage the size of the overall object (has to be size of screen) and the size of transparent window.

Any other suggestions, please?
 
Upvote 0

MoraviaVenus

Member
Licensed User
Longtime User
In the meantime I implement dirty solution, that works for rectangle window. It is composed from four separate panels:

horse2.png



More challenging will it be with rounded window :)
 
Upvote 0

MaFu

Well-Known Member
Licensed User
Longtime User
Create a mutable bitmap with your needed dimensions.
Use paint functions to draw a rect in the bitmap with your favorite color.
Draw another smaller rect (or circle ;)) with full transparency.
Now create a BitmapDrawable, initialize it with your bitmap and assign it to the panel background.
The ABExtDrawing lib can help you with the paint functions.
 
Upvote 0
Top