Sub Process_Globals
Private xui As XUI
Private ImageView1 As ImageView
...
Sub Test
Dim Bitmap1 As B4XBitmap = xui.LoadBitmap(File.DirAssets,"test.jpg")
Dim bc As BitmapCreator
bc.Initialize(Bitmap1.Width,Bitmap1.Height)
bc.CopyPixelsFromBitmap(Bitmap1)
Dim x As Int
Dim y As Int
Dim pixel As ARGBColor
For x = 0 To bc.mWidth-1
For y = 0 To bc.mHeight-1
bc.GetARGB(x,y,pixel)
If (pixel.r > 200 And pixel.g > 200 And pixel.b > 200 ) Then
pixel.r = 255 - pixel.r
pixel.g = 255 - pixel.g
pixel.b = 255 - pixel.b
End If
bc.SetARGB(x,y,pixel)
Next
Next
ImageView1.SetImage(bc.Bitmap) '< a ImageView in layout
Bitmap1 = bc.Bitmap
Dim Out As OutputStream
Log(File.DirTemp)
Out = File.OpenOutput(File.DirTemp, "Output.png", False)
Bitmap1.WriteToStream(Out, 100, "PNG")
Out.Close
End Sub