Dim gif As RSAnimatedGifEncoder
Dim out2 As OutputStream
out2 = File.OpenOutput(dir , "1.gif", False)
gif.start(out2)
gif.addFrame(btmp1)
gif.addFrame(btmp2)
gif.finish
Public Sub ImageToBytes(Image As Bitmap) As Byte()
Dim out As OutputStream
out.InitializeToBytesArray(0)
Image.WriteToStream(out, 100, "JPEG")
out.Close
Return out.ToBytesArray
End Sub
Public Sub BytesToImage(bytes() As Byte) As Bitmap
Dim In As InputStream
In.InitializeFromBytesArray(bytes, 0, bytes.Length)
Dim bmp As Bitmap
bmp.Initialize2(In)
Return bmp
End Sub
This code is no longer needed. Use File.WriteBytes / ReadBytes. Write an array of bytes to a file and read a file into an array of bytes. Sub BytesToFile (Dir As String, FileName As String, Data() As Byte) Dim out As OutputStream = File.OpenOutput(Dir, FileName, False)...
This code is no longer needed. Use File.WriteBytes / ReadBytes. Write an array of bytes to a file and read a file into an array of bytes. Sub BytesToFile (Dir As String, FileName As String, Data() As Byte) Dim out As OutputStream = File.OpenOutput(Dir, FileName, False)...
you have an example that is included and shows how to create the gif. the gif is stored in File.Dirdocuments and you can then share it or load or what ever you want to do.
to create the gif you just need to create a list and load it with the frames (images). the type should be Bitmap. then you create the gif bycalling the .create method and you put the name of the gif and the speed of the gif between 0 to 1 (Float)