The GifImage method writes the image to GIF format.

GifImage nTransparent, nInterlaced, sFileName


Specifies should GIF file have transparent color.
If nTransparent is zero or grater, this is the number of transparent color in the image palette.
If nTransparent is -1, the GIF image will not have transparent color.

Specifies should GIF file be interlaced. If this parameter is zero, GIF file will not be interlaced. Otherwise the GIF will be interlaced.

String specifying the name of the file to write to. If sFileName is a zero length string, the result GIF image will be produces as SAFEARRAY return value. You can use this for generation of images with ASP and sending them to client instead of writing to file.

Return Value

This method returns binary GIF image, if sFileName parameter is zero length string.


For generation of images with ASP and sending them to client use BinaryWrite method of Response object.
If you add other colors in your image by using antialiased texts and lines, reading images etc. you should rebuild image palette using the BuildPalette function.