FUNCTION TesteImagem( cFOTO, ngrau )
********************
LOCAL im, rotated, rotatedEx, cFif, cDef
fi_Initialise()
cFif := iif( at( ".BMP", upper(cFoto) ) > 0, FIF_BMP, FIF_JPEG )
cDef := iif( at( ".BMP", upper(cFoto) ) > 0, BMP_DEFAULT, JPEG_DEFAULT )
cExt := iif( at( ".BMP", upper(cFoto) ) > 0, ".bmp", ".jpg" )
im := fi_Load( cFif, cFOTO, cDef )
msgstop( "Rotate Classic :" + cvaltochar( rotated := fi_RotateClassic( im, ngrau ) ) + CRLF + ;
"Save ? :" + cvaltochar( fi_Save( cFif, rotated, "rotac"+strzero(ngrau,3)+cExt, cDef ) ), "Rotate " + str( ngrau, 3 ) )
fi_Unload( rotated )
centerx := fi_GetWidth( im ) / 2
centery := fi_GetHeight( im ) / 2
msgstop( "Rotate Ex : " + cvaltochar( rotatedEx := fi_RotateEx( im, nGrau, 0, 0, centerx, centery, TRUE ) ) + CRLF + ;
"Save ? : " + cvaltochar( fi_Save( cFif, rotatedEx, "rotae"+strzero(ngrau,3)+cExt, cDef ) ), "RotateEx " + str( ngrau, 3 ) )
fi_Unload( rotatedEx )
fi_unload(im)
fi_Deinitialise()
RETURN(NIL)
DLL32 STATIC FUNCTION FIInitialise( lLoadPlug AS LONG) AS VOID;
PASCAL FROM "_FreeImage_Initialise@4" LIB hLib
DLL32 STATIC FUNCTION FIDeInitialise( ) AS VOID;
PASCAL FROM "_FreeImage_DeInitialise@0" LIB hLib
DLL32 STATIC FUNCTION FIGetWidth ( hDib AS LONG ) AS LONG;
PASCAL FROM "_FreeImage_GetWidth@4" LIB hLib
DLL32 STATIC FUNCTION FIGetHeight ( hDib AS LONG ) AS LONG;
PASCAL FROM "_FreeImage_GetHeight@4" LIB hLib
DLL32 STATIC FUNCTION FIRotate ( hDib AS LONG, nAngle AS _DOUBLE ) AS LONG;
PASCAL FROM "_FreeImage_RotateClassic@12" LIB hLib
DLL32 STATIC FUNCTION FIRotateEX ( hDib AS LONG, nAngle AS _DOUBLE, x_Shift AS _DOUBLE,y_Shift AS _DOUBLE,;
x_Orig AS _DOUBLE, y_Orig AS _DOUBLE, lMask AS BOOL ) AS LONG;
PASCAL FROM "_FreeImage_RotateEx@48" LIB hLib
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 86 guests