FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour rotate bmp 90- 180 270 grades
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
rotate bmp 90- 180 270 grades
Posted: Fri Dec 15, 2006 03:02 AM

can I rotate a BMP ?


Best Regards, Saludos



Falconi Silvio
Posts: 344
Joined: Tue Oct 11, 2005 11:33 AM
rotate bmp 90- 180 270 grades
Posted: Sun Dec 24, 2006 05:35 PM
Hello Silvio,

Yes, but in black and white. Already in the format JPEG functions 100%

See the down the example using. BMP:



See the down the example using. JPG



The code:

#include "FreeImage.ch"  && This should be before of "fivewin.ch"
#include "fivewin.ch"
#include "common.ch"

*************
function main
*************

local cFoto := "FIVEWIN.bmp"

testeimagem( cFoto, 0   )
testeimagem( cFoto, 60  )
testeimagem( cFoto, 90  )
testeimagem( cFoto, 180 )
testeimagem( cFoto, 270 )

cFoto := "FIVEWIN.jpg"

testeimagem( cFoto, 0   )
testeimagem( cFoto, 60  )
testeimagem( cFoto, 90  )
testeimagem( cFoto, 180 )
testeimagem( cFoto, 270 )

RETURN NIL

********************
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)


For this function you be necessary use the class freeimage of xharbour.org, located in โ€œ\xharbour\contrib\freeimage\.."

Regards,

Rossine.
Obrigado, Regards, Saludos



Rossine.



Harbour and Harbour++
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
rotate bmp 90- 180 270 grades
Posted: Sat Dec 30, 2006 02:01 AM
Hi Mr.Rossine


For this function you be necessary use the class freeimage of xharbour.org, located in โ€œ\xharbour\contrib\freeimage\.."


I don't have a copy of this class.

Can you please send this class and its .ch file to my private e-mail: aksharasoft@hotmail.com
Regards,

- Ramesh Babu P
Posts: 344
Joined: Tue Oct 11, 2005 11:33 AM
rotate bmp 90- 180 270 grades
Posted: Sat Dec 30, 2006 10:38 AM
Obrigado, Regards, Saludos



Rossine.



Harbour and Harbour++
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
rotate bmp 90- 180 270 grades
Posted: Sun Dec 31, 2006 01:27 PM

Hi Mr.Rossine

I have this zip file already. But I could not trace the .PRG containing the FreeImage Class. Can you please name the .PRG?

Thanks

Ramesh Babu P

Posts: 344
Joined: Tue Oct 11, 2005 11:33 AM
rotate bmp 90- 180 270 grades
Posted: Tue Jan 02, 2007 11:01 AM

Hi Ramesh,

Enclose these springs in his project.

\xharbour\contrib\freeimage\source\fi_wrp.c
\xharbour\contrib\freeimage\source\fi_winfu.c

It is necessary also generate to lib of freeimage.dll, like this:

dll2lib freeimage

... And it include to lib generated in his project also.

Regards,

Rossine.

Obrigado, Regards, Saludos



Rossine.



Harbour and Harbour++
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
rotate bmp 90- 180 270 grades
Posted: Wed Jan 03, 2007 02:38 AM

Hello Rossine

Thank you very much.

Regards

  • Ramesh Babu P

Continue the discussion