Android Question [RESOLVED] Remove top of the panel edge

Lucas Siqueira

Active Member
Licensed User
Hello everyone!

how can I make a border on a panel and then remove a top part of the border to put a label with a transparent background.

note that the background color of the panel is transparent.

I need the background to be transparent because there are screens for apps that contain gradients.

1598353059394.png
 

Biswajit

Active Member
Licensed User
B4X:
Dim bc As BitmapCreator
bc.Initialize(panel.Width,panel.Height)

bc.DrawRectRounded(bc.TargetRect,Colors.Black,False,2dip,5dip)
Dim r As B4XRect
r.Initialize(10dip,0,100dip,10dip)
bc.DrawRect(r,Colors.Transparent,True,0)

Dim bmp As B4XBitmap = bc.Bitmap
panel.SetBackgroundImage(bmp)
 
Last edited:
Upvote 0

Lucas Siqueira

Active Member
Licensed User
B4X:
Dim bc As BitmapCreator
bc.Initialize(panel.Width,panel.Height)

Dim r As B4XRect=bc.TargetRect
bc.DrawRectRounded(r,Colors.Black,False,2dip,5dip)
r.Left = 10dip
r.Width = 100dip
r.Height = 10dip
bc.DrawRect(r,Colors.Transparent,True,0)

Dim bmp As B4XBitmap = bc.Bitmap
panel.SetBackgroundImage(bmp)

very good, thank you!
 
Upvote 0
Top