Sub Globals
Private ImageView1 As B4XView
Private xui As XUI
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Dim img As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "1.jpg.png", ImageView1.Width, ImageView1.Height, False)
ImageWithTopCorners(img, ImageView1, 20dip)
End Sub
Sub ImageWithTopCorners (bmp As B4XBitmap, iv As B4XView, Radius As Int)
Dim bc As BitmapCreator
bc.Initialize(iv.Width, iv.Height)
Dim brush As BCBrush = bc.CreateBrushFromBitmap(bmp)
Dim rect As B4XRect
rect.Initialize(0, 0, bc.mWidth - 1, bc.mHeight)
bc.DrawRectRounded2(rect, brush, True, 0, Radius)
rect.Initialize(0, bc.mHeight - Radius, bc.mWidth, bc.mHeight)
bc.DrawRect2(rect, brush, True, 0)
bc.SetBitmapToImageView(bc.Bitmap, iv)
End Sub