Sub Process_Globals
Private MainForm As Form
Private ImageView1 As ImageView
Private xui As XUI
Private ImageView2 As ImageView
Private ImageView3 As ImageView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
MainForm.Show
CreateComicBalloon(ImageView1)
CreateComicBalloon(ImageView2)
CreateComicBalloon(ImageView3)
End Sub
Sub CreateComicBalloon (ImageView As B4XView)
Dim bcGradient As BitmapCreator
bcGradient.Initialize(ImageView.Width / xui.Scale, ImageView.Height / xui.Scale)
bcGradient.FillGradient(Array As Int(xui.Color_White, 0xFFCACACA), bcGradient.TargetRect, "TOP_BOTTOM")
Dim bc As BitmapCreator
bc.Initialize(bcGradient.mWidth, bcGradient.mHeight)
Dim brush As BCBrush = bc.CreateBrushFromBitmapCreator(bcGradient)
Dim borderBrush As BCBrush = bc.CreateBrushFromColor(xui.Color_Black)
Dim r As B4XRect
r.Initialize(0, 0, bc.mWidth, bc.mHeight * 0.8)
bc.DrawRectRounded2(r, brush, True, 0, 50)
bc.DrawRectRounded2(r, borderBrush, False, 2, 50)
Dim path As BCPath
Dim len As Int = (bc.mHeight - r.Bottom) / 3
path.Initialize(60, r.Bottom-2)
path.LineTo(60 + len, bc.mHeight)
path.LineTo(60 + 2 * len, r.Bottom-2)
bc.DrawPath2(path, brush, True, 0)
path.RemoveLastPoint
bc.DrawPath2(path, borderBrush, False, 1)
bc.SetBitmapToImageView(bc.Bitmap, ImageView)
End Sub