iOS Question how to make a degraded panel to transparent?

hameth abdelwa

New Member
hello I am trying to make a gradient panel, color_1 is black but color_2 I would like it to be transparent.

I already tried with some functions that I saw here in the forum but it only allows me to degrade 2 solid colors, is it possible to degrade from a solid color to transparent? Thank you
 

hameth abdelwa

New Member
here I am calling the function
B4X:
SetGradientBackground(Panel2, Array As Int(0xFF000000,Colors.Transparent), "TOP_BOTTOM")
this is the bitmap function
B4X:
public Sub SetGradientBackground(pnl As B4XView, Clrs() As Int, Orientation As String)
    Dim bc As BitmapCreator
    bc.Initialize(pnl.Width / xui.Scale, pnl.Height / xui.Scale)
    bc.FillGradient(Clrs, bc.TargetRect, Orientation)
    Dim iv As ImageView
    iv.Initialize("")
    Dim xiv As B4XView = iv
    pnl.AddView(xiv, 0, 0, pnl.Width, pnl.Height)
    xiv.SendToBack
    bc.SetBitmapToImageView(bc.Bitmap, xiv)
End Sub



 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…