Private Sub SetAlphaToImage(TargetImage As B4XBitmap, ValueAlpha As Int) As B4XBitmap
Dim bc As BitmapCreator
bc.Initialize(TargetImage.Width, TargetImage.Height)
bc.CopyPixelsFromBitmap(TargetImage)
Dim ARGBColor1 As ARGBColor
For x = 0 To bc.mWidth - 1
For y = 0 To bc.mHeight - 1
bc.GetARGB(x, y, ARGBColor1)
If ARGBColor1.a > 0 Then
ARGBColor1.a = ValueAlpha
bc.SetARGB(x, y, ARGBColor1)
bc.BlendPixel(bc, x, y, x, y)
End If
Next
Next
Return bc.Bitmap
End Sub