IUP-IM

IUP - Portable User Interface

IUP-IM Functions

Functions to load and save an IupImage from file using the IM library. The function can load or save the formats: BMP, JPEG, GIF, TIFF, PNG, PNM, PCX, ICO and others. For more information about the IM library see http://www.tecgraf.puc-rio.br/im.

Initialization and Usage

To generate an application that uses this function, the program must be linked with the IM library and with the function library (im and iupim libraries). The iupim.h file must also be included in the source code.

To make the function available in Lua, use the initialization function in C, iupimlua_open, after calling iuplua_open. The iupluaim.h file must also be included in the source code. The program must be linked to the lua functions library (iupluaim library).

Load

Ihandle* IupLoadImage(const char* file_name); [in C]
iup.LoadImage{file_name: string} -> (elem: ihandle) [in Lua]

file_name: Name of the file to be loaded.

This function returns the identifier of the created image, or NULL if an error occurs. When failed a message box describing the error is displayed.

Save

int IupSaveImage(Ihandle* elem, const char* file_name, const char* format); [in C]
iup.SaveImage{elem: ihandle, file_name, format: string} -> (ret: number) [in Lua]

elem: handle of the IupImage.
file_name: Name of the file to be loaded.
format: format descriptor for IM.

This function returns zero if failed. When failed a message box describing the error is displayed.

See Also

IupImage