#include "_GDIPlus_GIFAnim.au3"
_GDIPlus_Startup()
Global $aImages[5] = [4]
For $i = 1 To 4
$aImages[$i] = _GDIPlus_ImageLoadFromFile($i & ".jpg")
If @error Then Exit MsgBox(0, _GDIPlus_Shutdown(), "Ошибка загрузки файла " & $i & ".jpg")
Next
_GDIPlus_GIFAnimCreateFile($aImages, "anim.gif", 1000)
If @error Then MsgBox(0, "Error", "Ошибка создания gif-файла")
For $i = 1 To 4
_GDIPlus_ImageDispose($aImages[$i])
Next
_GDIPlus_Shutdown()
$Name = "anim.gif"
$File = FileOpen($Name, 16 + 1)
FileSetPos($File, -1, 2)
If FileRead($File, 1) = 0x3B Then FileSetPos($File, -1, 2)
FileWrite($File, Binary("0x21FF0B4E45545343415045322E3003010000003B"))
FileClose($File)