Functions


GIFLoadHeader

GIFLoadHeader lpGifInfo:DWORD

function

Initializes the GIF decoder. This function should be called once for each gif that is decoded, The GIF_INFO structure is prepared for using GIFDecompress.

parameters

lpGifInfo Pointer to a GIF_INFO Structure that defines the GIF to use. The lpGIFData member of the structure should point to the raw GIF image data, the dwGIFDataSize member is the size of the data pointed to by lpGIFData

return value

The function returns TRUE if successful, FALSE if it failed. The GIFVersion, dwLSWidth and dwLSHeight members of the GIF_INFO are filled by the structure.


GIFInitalizeDecoder

GIFInitalizeDecoder lpGifInfo:DWORD

function

Initializes the GIF decoder. This function should be called once for each gif that is decoded, The GIF_INFO structure is prepared for using GIFDecompress. Always use GIFLoadHeader before GIFInitializeDecoder

parameters

lpGifInfo Pointer to a GIF_INFO Structure that defines the GIF to use. The structure should be initialized by GIFLoadHeader

return values

Returns TRUE if successful, FALSE if it failed. The following members of the GIF_INFO structure are initialized by the function:

lpColorTable Pointer to the GIF's color table (RR GG BB format)
ColorCount Number of colors in the GIF image
dwImageWidth Width of the GIF Image
dwImageHeight Height of the GIF Image

GIFGetColorTable

GIFGetColorTable lpGifInfo:DWORD, lpBuffer:DWORD

function

Retrieves the colortable to a given buffer as an array of RGBQUAD structures. Use this function for compatibility with the windows GDI functions.

parameters

lpGifInfo Pointer to a GIF_INFO Structure that defines the GIF to use. The structure should be initialized by GIFLoadHeader and GIFInitializeDecoder.
lpBuffer Points to a buffer that receives the color table as an array of RGBQUADs

remarks

The size of lpBuffer can be found by multiplying the number of colors in the color table by the size of a RGBQUAD structure (=4 bytes):
SizeOf(lpBuffer) = GifInfo.ColorCount * 4

return value

This function does not return a value.


GIFGetMinimumColorType

GIFGetMinimumColorType lpGifInfo:DWORD

function

Retrieves the output color type that ensures the smallest possible output format.

parameters

lpGifInfo Pointer to a GIF_INFO Structure that defines the GIF to use. The structure should be initialized by GIFLoadHeader and GIFInitializeDecoder.

return value

This function returns IMAGEFORMAT_1BIT, IMAGEFORMAT_4BIT or IMAGEFORMAT_8BIT. You can use the return value as output format when decoding the GIF. GIFGetMinimumColorType ensures that this output format gives the smallest output data. You can always use a higher output format (i.e. higher nr of bits), lower is not supported.


GIFGetOutputSize

GIFGetOutputSize lpGifInfo:DWORD

function

Retrieves the number of bytes to reserve for the output data.

parameters

lpGifInfo Pointer to a GIF_INFO Structure that defines the GIF to use. The structure should be initialized by GIFLoadHeader and GIFInitializeDecoder.

return value

The return value indicates the number of bytes that should be allocated to fit the output data size.


GIFDecompress

GIFDecompress lpGifInfo:DWORD

function

This is the main decompression function. It decompresses the GIF Image to the buffer pointed to by the lpImageData member of the GIF_INFO structure, in the format defined by the dwImageFormat member.

parameters

lpGifInfo Pointer to a GIF_INFO Structure that defines the GIF to use. The structure should be initialized by GIFLoadHeader and GIFInitializeDecoder.

return value

The function returns TRUE if successful.


GIFCleanup

GIFCleanup lpGifInfo:DWORD

function

Cleans the memory that is used internally by GIFLIB. This function should be called after using the decoder.

parameters

lpGifInfo Pointer to a GIF_INFO Structure.

return value

This function does not return a value.


GIFFillBitmapInfoStruct

GIFFillBitmapInfoStruct lpGifInfo:DWORD, lpBitmapInfoHeader:DWORD

function

GIFFillBitmapInfoStruct fills a BITMAPINFOHEADER with the right values from a GIF_INFO Structure.

parameters

lpGifInfo

Pointer to a GIF_INFO Structure.
The dwImageWidth, dwImageHeight and dwImageFormat of this structure should have the right values. These values are set by GIFInitializeDecoder.

lpBitmapInfoHeader

Pointer to a BITMAPINFOHEADER structure to be filled in.

return value

This function does not return a value.


GIFLoadResource

GIFLoadResource lpGifInfo:DWORD, hInstance:DWORD, lpName:DWORD

function

Loads a GIF in the form of a resource of the RT_RCDATA type, and sets the lpGIFData and dwGIFDataSize members of the GIF_INFO structure.

parameters

lpGifInfo

Pointer to a GIF_INFO Structure.
The lpGIFData and dwGIFDataSize members of the structure are set by GIFLoadResource

lpBitmapInfoHeader

Identifies the module whose executable file contains the resource.

lpName Specifies the name of the resource or, if the high word of the parameter is NULL, a resource ID.

return value

This function does not return a value.


GIFLoadFile

GIFLoadFile lpGifInfo:DWORD, lpFile:DWORD

function

Loads a GIF-File from harddisk for use with the library.
NOTE: The lpGIFData member of the GIF_INFO structure is set to a pointer to the data in the file. You should free this memory using GlobalFree if the data is not needed anymore.

parameters

lpGifInfo

Pointer to a GIF_INFO Structure.
The lpGIFData and dwGIFDataSize members of the structure are set by GIFLoadFile.

lpFile

Points to a string that specifies the filename of the GIF to be loaded

return value

This function does not return a value.