DevIL Documentation Home | Previous | Next

ilSave

The ilSave function saves the current image as a specified type of image file.


ILboolean ilSave(
  ILenum Type,
  char *FileName
);

Parameters

Type
IL_BMP
Save the image as a Microsoft bitmap (.bmp).
IL_CHEAD
Save the image as a C-style header (.h).
IL_JPG
Save the image as a Jpeg (.jpg, .jpeg).
IL_PCX
Save the image as a PCX.
IL_PNG
Save the image as a Portable Network Graphics (.png) image.
IL_PNM
Save the image as a Portable AnyMap (.pbm, .pgm or .ppm).
IL_RAW
Save a raw dump of the image data to disk as FileName.
IL_SGI
Save the image as a SGI (.bw, .rgb, .rgba or .sgi).
IL_TGA
Save the image as a TrueVision Targa.
IL_JASC_PAL
Save the current image's palette as a Paint Shop Pro (Jasc) palette (.pal).
FileName
The filename of the file to save to.

Remarks

ilSave can be used much in the same way ilSaveImage is used, except with ilSave, it is possible to force OpenIL to save a file as a specific image format, no matter what the extension.

Error Codes

IL_INVALID_ENUM - Type was of an invalid value.
IL_COULD_NOT_OPEN_FILE - Could not open FileName for writing.

See Also

ilSaveImage, ilLoad, ilLoadF, ilLoadL, ilLoadImage