Hi !
1. // comes from image.prg
static function FISAVEIMG( cSrcFile, cDstFile, nDstFormat, nQuality )
local nSrcFormat, hDib, hDib2, lOk := .f.
DEFAULT nQuality := 0
if LoadFreeImage() > 32
nSrcFormat = FIGETFILETYPE( cSrcFile, 0 )
hDib = FILOAD( nSrcFormat, cSrcFile, 0 )
hDib2 = FICNV24( hDib )
lOk = FISAVE( nDstFormat, hDib2, cDstFile, nQuality )
FIUNLOAD( hDib )
FIUNLOAD( hDib2 )
endif
return lOk
2.myapp.prg
static hLib
...
... buttion action FISAVEIMG( "tmp1.bmp", "tmp1.jpg", 2, 95)
DLL32 FUNCTION FISAVE( nFormat AS LONG, hDib AS LONG, cFileName AS LPSTR, nFlags AS LONG ) AS BOOL ;
PASCAL FROM "_FreeImage_Save@16" LIB hLib
DLL32 FUNCTION FILOAD( nFormat AS LONG, cFileName AS LPSTR, nFlags AS LONG ) AS LONG ;
PASCAL FROM "_FreeImage_Load@12" LIB hLib
...
3.runtime error :
Error description: Error BASE/1099 Argument error: STR
Args:
[ 1] = U
Called from: => STR(0)
Called from: bas.prg =>FIGETFILETYPE(6872)
TKS!
Shuming Wang