Android Question Does B4X BitmapCreator support transparency in FillRadialGradient?


Well-Known Member
Licensed User
Longtime User
It seems that B4X BitmapCreator does not support transparency in FillRadialGradient, can this be correct?

The code below draws a FillRadialGradient above a FillGradient, but the FillRadialGradient does not seem to be transparent at the edges despite specifiying xui.Color_Transparent.

Sub SetGradientBackground(v As B4XView, Clrs() As Int, Orientation As String)
    Dim bc As BitmapCreator
    bc.Initialize(v.Width / xui.Scale, v.Height / xui.Scale)
    bc.FillGradient(Clrs, bc.TargetRect, Orientation)
    Dim rect As B4XRect
    rect.Initialize( 0, 0, bc.mWidth-1, bc.mHeight-1 )
    bc.FillRadialGradient( Array As Int(xui.Color_white, xui.Color_Transparent) , rect )
    Dim iv As ImageView
    Dim xiv As B4XView = iv
    v.AddView(xiv, 0, 0, v.Width, v.Height)
    bc.SetBitmapToImageView(bc.Bitmap, xiv)
End Sub