Sub generateGIF
Dim BitmapList As List
BitmapList .Initialize
'Each frame contains 256 pixelcolors
For Each frame As List In FrameList
Dim bc As BitmapCreator
bc.Initialize(8,8)
For y = 0 To 8 - 1
For x = 0 To 8 - 1
Dim i As Float = y * 8 + x
Dim a As ARGBColor
bc.SetARGB(x,y,bc.ColorToARGB(frame.Get(i),a))
Next
Next
BitmapList.Add(bc.Bitmap)
Next
#if b4a
Dim out As OutputStream
out = File.OpenOutput(File.DirInternal, "Test.gif", False)
gif.FrameRate=Speed
gif.Repeat=0
gif.Quality=20
gif.start(out)
For Each b As B4XBitmap In BitmapList
gif.addFrame(b)
Next
gif.finish
out.close
#else if b4i
myGifmaker.Initialize
myGifmaker.create(BitmapList,"Test.gif",Speed/100)
#End If
End If