Android Question Panel with cut out window

MoraviaVenus

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

MoraviaVenus

Member
Licensed 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 :)
 

MaFu

Well-Known Member
Licensed 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.
 
Top