Sub AddSomeColors(QRBmp As B4XBitmap, logo As B4XBitmap) As B4XBitmap
Dim bc As BitmapCreator
bc.Initialize(QRBmp.Width, QRBmp.Height)
bc.CopyPixelsFromBitmap(QRBmp)
Dim LogoBC As BitmapCreator
LogoBC.Initialize(QRBmp.Width/5, QRBmp.Height/5)
LogoBC.CopyPixelsFromBitmap(logo)
Dim argb, largb As ARGBColor
For x = 0 To bc.mWidth - 1
For y = 0 To bc.mHeight - 1
bc.GetARGB(x, y, argb)
LogoBC.GetARGB(x/5, y/5, largb) 'this line caused error: java.lang.ArrayIndexOutOfBoundsException: length=37636; index=37639
If largb.a > 0 Then
largb.a = 200
LogoBC.SetARGB(x/5, y/5, largb)
bc.BlendPixel(LogoBC, x/5, y/5, x, y)
End If
Next
Next
Return bc.Bitmap
End Sub