Encoding (egif_lib.c)
The high-level function
int EGifSpew(GifFileType *GifFile)
writes a complete (possibly multi-image) GIF file to the indicated file handle from in-core allocated structures created by a previous DGifSlurp() or equivalent operations. Its argument is a GIF file descriptor, which imnplicitly points to storage previously allocated by DGifSlurp().
The file is written with a GIF87 stamp unless it contains one of the four special extension blocks defined in GIF89, in which case it is written with a GIF89 stamp.
EGifSpew() finishes by closing the GIF (writing a termination record to it) and deallocating the associated storage.
You can write to a GIF file through a function hook. Initialize with
GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *ErrorCode)
and see the library header file for the type of OutputFunc.
There is also a set of deprecated functions for sequential I/O, described in a later section.
不知道是不是这块?
http://giflib.sourceforge.net/gif_lib.html#idm46571690348944
你研究研究给我们分享一下