procedure Sav_Img
local hDib:=DibFromBitmap( oWnd:aControls[3]:GetHBitmap() )
local cTempFile := cTempFile()
local lSaved
nFormat:=13
nQuality:=25
cFile:="my.png"
DibWrite( cTempFile, hDib )
GloBalFree( hDib )
lSaved = FIConvertImageFile( cTempFile, cFile, nFormat, nQuality )
FErase( cTempFile )
return
function FIConvertImageFile( 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
oImage := GdiBmp():New( "oldfile.png" )
oImage:Rotate( nRotate )
oImage:Save( "newfile.png" )
oImage:End()
James Bott wrote:Nages,
May I suggest just using the degrees themselves (90,180,270) for the rotation rather than a code (1,2,3)? This would be easier to remember.
James
James Bott wrote:Nages,
Actually, would it be possible to rotate in degree increments( e.g. 92 degrees)? This would help de-skew crooked scans, etc..
James
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 59 guests