Sub Globals
Dim bmp As Bitmap 'final bitmap
Dim i As ImageView 'imageview to hold final bitmap
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim a(10000) As Int 'array of colors in argb format
'We will first fill the array with a black circle in a white square
Dim x As Int
Dim y As Int
For x = 0 To 99
For y = 0 To 99
If (x-50)*(x-50)+(y-50)*(y-50) < 2500 Then
a(x+y*100) = 0xff000000 'black
Else
a(x+y*100) = 0xffffffff 'white
End If
Next
Next
bmp.InitializeMutable(100,100) 'initialize the bitmap as mutable
Dim jo As JavaObject = bmp 'create a java object and point it to the bitmap
jo.RunMethod("setPixels",Array As Object(a,0,100,0,0,100,100)) 'run the setPixels method
i.Initialize("") 'initialize the imageView
i.SetBackgroundImage(bmp) 'set the imageView background to the bitmap
Activity.AddView(i,10dip,10dip,100dip,100dip) 'add the imageView to the activity
End Sub