Imports Gif.Components
Imports System.Drawing.Imaging
Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal er As System.EventArgs) Handles Button1.Click
' Создаём гиф
' Здесь пути для файлов
Dim imageFilePaths As [String]() = New [String]() {"C:\01i.png", "C:\02i.png", "C:\03i.png"}
Dim outputFilePath As [String] = "C:\test.gif"
Dim e As New AnimatedGifEncoder()
e.Start(outputFilePath)
e.SetDelay(500) ' Здесь интервал
'-1:не повторять,0:повторять бесконечно
e.SetRepeat(0)
Dim ie As Integer = 0, counte As Integer = imageFilePaths.Length
While ie < counte
e.AddFrame(Image.FromFile(imageFilePaths(ie)))
ie += 1
End While
e.Finish()
' сохранить гиф
Dim outputPath As String = "C:\"
Dim gifDecoder As New GifDecoder()
gifDecoder.Read("C:\test.gif")
Dim i As Integer = 0, count As Integer = gifDecoder.GetFrameCount()
While i < count
Dim frame As Image = gifDecoder.GetFrame(i)
frame.Save(outputPath & Guid.NewGuid().ToString() & ".png", ImageFormat.Png)
i += 1
End While
End Sub
End Classтак у меня возникли еще вопросы как настроить размер выходного изображения?


:исходники на cs и на vb этой библиотеки.