示例#1
0
/*****************************************************************************\
 im.FileOpenAs(filename)
\*****************************************************************************/
static int imluaFileOpenAs (lua_State *L)
{
  const char *filename = luaL_checkstring(L, 1);
  const char *format = imlua_checkformat(L, 2);
  int error;
  imFile *ifile = imFileOpenAs(filename, format, &error);
  return imlua_pushifileerror(L, ifile, error);
}
示例#2
0
文件: imlua_image.c 项目: LuaDist/im
/*****************************************************************************\
 image:Save(filename, format)
\*****************************************************************************/
static int imluaImageSave (lua_State *L)
{
  imImage *image = imlua_checkimage(L, 1);
  const char *file_name = luaL_checkstring(L, 2);
  const char *format = imlua_checkformat(L, 3);

  imlua_pusherror(L, imFileImageSave(file_name, format, image));
  return 1;
}