単純に表示するだけなら。
GdipImageGetFrameCountで画像の枚数を取得し、GdipGetPropertyItemでPropertyTagFrameDelayを指定してDerayを取得。
表示する際はGdipImageSelectActiveFrameで表示するフレームを指定してからGdipDrawImageI等で描画してください。
delay値は1/100s単位なのでawaitの1/1000sに揃えるために10倍にしています。
ループ回数はGdipGetPropertyItemでPropertyTagLoopCount(0x5101)を指定して取得可能です。
簡素化してるので、使用する際はエラーチェック等追加してください。
#uselib "gdiplus.dll"
#func GdipCreateFromHDC "GdipCreateFromHDC" int, int
#func GdipDeleteGraphics "GdipDeleteGraphics" int
#func GdipDisposeImage "GdipDisposeImage" int
#func GdipDrawImageI "GdipDrawImageI" int, int, int, int
#func GdipGetPropertyItemSize "GdipGetPropertyItemSize" int,int,int
#func GdipGetPropertyItem "GdipGetPropertyItem" int,int,int,int
#func GdipImageGetFrameDimensionsList "GdipImageGetFrameDimensionsList" int,int,int
#func GdipImageGetFrameCount "GdipImageGetFrameCount" int,int,int
#func GdipImageSelectActiveFrame "GdipImageSelectActiveFrame" int,int,int
#func GdiplusShutdown "GdiplusShutdown" int
#func GdiplusStartup "GdiplusStartup" int, int, int
#func GdipLoadImageFromFile "GdipLoadImageFromFile" wstr,int
#define PropertyTagFrameDelay 0x5100
dialog "gif",16,"" : if( stat != 1 ): end
file = refstr
gsi = 1, 0, 0, 0
GdiplusStartup varptr(gdiplusToken), varptr(gsi), 0 ; GDI+ 開始
if( gdiplusToken == 0 ):dialog "初期化失敗",1: end
GdipLoadImageFromFile file, varptr(imgImage); ファイルから読み込み
if( imgImage == 0 ): dialog "ロード失敗",1:GdiplusShutdown gdiplusToken: end
GdipImageGetFrameDimensionsList imgImage , varptr(guid) , 1;最初のディメンションのGUIDを取得
GdipImageGetFrameCount imgImage , varptr(guid) , varptr(frames);フレーム数を取得
GdipGetPropertyItemSize imgImage , PropertyTagFrameDelay , varptr(nSize);ディレイを格納するサイズを取得
sdim Delay , nSize
GdipGetPropertyItem imgImage , PropertyTagFrameDelay , nSize , varptr(Delay);ディレイを取得
GdipCreateFromHDC hdc ,varptr(tmpGraphics)
color 255,255,255
repeat frames
redraw 0
boxf
GdipImageSelectActiveFrame imgImage , varptr(guid) , cnt;アクティヴなフレームを選択
GdipDrawImageI tmpGraphics, imgImage ,0,0
redraw 1
await 10 * lpeek( Delay , cnt * 4 + 16);先頭16byteはPropertyItem
loop
GdipDeleteGraphics tmpGraphics
GdipDisposeImage imgImage
GdiplusShutdown gdiplusToken;GDI+ 終了
stop