Saludos.
Necesito rotar una imagen, con Gdiplus lo hace bien y con freeimage tambi茅n lo hace bien, pero en win64 bits en ambos casos da error
Ejemplo que funciona bien
Hay que tener en cuenta que para freeimage modifique el image.prg agregando el metodo de rotaci贸n
METHOD RotateImage( nAngle )
.....
Agregue la funcion
y por ultimo
Toda esta informaci贸n est谩 en los foros
Actualmente trabajo con
Fivewin 15.09
Harbour 3.2.0
Visual Studio 2013
MariaDb/MySql
Gracias.
Necesito rotar una imagen, con Gdiplus lo hace bien y con freeimage tambi茅n lo hace bien, pero en win64 bits en ambos casos da error
Ejemplo que funciona bien
// Testing
#include "FiveWin.ch"
function Main()
Local oImg
聽 聽Local nFlags 聽 := nOr( OFN_PATHMUSTEXIST , OFN_NOCHANGEDIR , ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽OFN_ALLOWMULTISELECT , OFN_EXPLORER , ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽OFN_LONGNAMES )
聽 聽Local cImg
聽 聽cImg := cGetFile( "Bitmap (*.bmp)| *.bmp|" + 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"DIB 聽 (*.dib)| *.dib|" + 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"PCX 聽 (*.pcx)| *.pcx|" 聽+ 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"JPEG 聽(*.jpg)| *.jpg|" + 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"GIF 聽 (*.gif)| *.gif|" 聽+ 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"TARGA (*.tga)| *.tga|" + 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"RLE 聽 (*.rle)| *.rle|" + 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"All Files (*.*)| *.*" 聽 聽 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ,"Seleciona una Imagen", 4,, .f., .t., nFlags )
聽 聽 聽 聽 聽 聽 //Forma 1
聽 聽 聽 聽 聽 聽 oImg:= GDIBmp():new( cImg )
聽 聽 聽 聽 聽 聽oImg:Rotate( 3 ) //Rota 270 grados
聽 聽 聽 聽 聽 聽oImg:Save( "Imagen1.bmp" ) //imagen ya rotada
聽 聽 聽 聽 聽 聽oImg:End()
聽 聽 聽 聽 聽 聽 //Forma 2
聽 聽 聽 聽 聽 聽Define Image oImg FileName cImg
聽 聽 聽 聽 聽 聽 聽 oImg:RotateImage( 270 ) //Rota 270 grados
聽 聽 聽 聽 聽 聽 聽 oImg:SaveImage( "Imagen2.bmp", 0, 0 ) //imagen ya rotada
聽 聽 聽 聽 聽 聽oImg:End()
return nil
//------------------------------------------------------------------------//
procedure appsys // XBase++ requirement
returnHay que tener en cuenta que para freeimage modifique el image.prg agregando el metodo de rotaci贸n
METHOD RotateImage( nAngle )
.....
METHOD RotateImage( nAngle ) CLASS TImage
聽 聽local hDib := DibFromBitmap( ::hBitmap )
聽 聽local cTempFile := cTempFile( , "BMP" )
聽 聽local lSaved, hBmp
聽 聽local hOldBmp 聽:= ::hBitmap
聽 聽local hOldPal 聽:= ::hPalette
聽 聽DibWrite( cTempFile, hDib )
聽 聽GloBalFree( hDib )
聽 聽
聽 聽hBmp := FIROTATEIMG( cTempFile, nAngle )
聽 聽FErase( cTempFile )
聽 聽
聽 聽IF hBmp != 0
聽 聽 聽 if ! Empty( hOldBmp )
聽 聽 聽 聽 聽 PalBmpFree( hOldBmp, hOldPal )
聽 聽 聽 endif
聽 聽 聽 聽 聽 聽
聽 聽 聽 ::hBitmap := hBmp
聽 聽 聽 聽
聽 聽 聽 PalBmpNew( ::hWnd, ::hBitmap, ::hPalette )
聽 聽 聽 聽
聽 聽 聽 ::Refresh()
聽 聽ENDIF 聽
return nilAgregue la funcion
Function FIROTATEIMG( cSrcFile, nAngle )
聽 聽local nSrcFormat, hDib, hDib2, lOk
聽 聽local nFormat, hInfoH, hInfo, hBits, hWnd, hDC, hBmp := 0
聽 聽nSrcFormat = FIGETFILETYPE( cSrcFile, 0 )
聽 聽hDib = FILOAD( nSrcFormat, cSrcFile, 0 )
聽 聽IF hDib <> 0
聽 聽 聽 hDib2 = FIRotate( hDib, nAngle )
聽 聽 聽 聽
聽 聽 聽 IF hDib2 <> 0
聽 聽 聽 聽 聽hInfoH 聽= FIGETINFOHEADER( hDib2 )
聽 聽 聽 聽 聽hInfo 聽 = FIGETINFO( hDib2 )
聽 聽 聽 聽 聽hBits 聽 = FIGETBITS( hDib2 )
聽 聽 聽 聽 聽hWnd 聽 聽= GETDESKTOPWINDOW()
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽
聽 聽 聽 聽 聽#ifdef __CLIPPER__
聽 聽 聽 聽 聽 聽 聽hDC = GETDC32( hWnd )
聽 聽 聽 聽 聽#else
聽 聽 聽 聽 聽 聽 聽hDC = GETDC( hWnd )
聽 聽 聽 聽 聽#endif
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽
聽 聽 聽 聽 聽hBmp = CreateDiBitmap( hDC, hInfoH, CBM_INIT, hBits, hInfo, DIB_RGB_COLORS )
聽 聽 聽 聽 聽 #ifdef __CLIPPER__
聽 聽聽 聽 聽 聽ReleaseDC32( hWnd, hDC )
聽 聽 聽 聽 #else
聽 聽 聽 聽 聽聽 聽ReleaseDC( hWnd, hDC )
聽 聽 聽 聽 聽 #endif
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽
聽 聽 聽 聽 聽FIUNLOAD( hDib2 )
聽 聽 聽 ENDIF 聽
聽 聽 聽 聽
聽 聽 聽 FIUNLOAD( hDib )
聽 聽ENDIF 聽 聽 聽 聽 聽
return hBmpy por ultimo
DLL32 FUNCTION FIRotate( hDib AS LONG, nAngle AS _DOUBLE ) AS LONG;
聽 聽 聽 PASCAL FROM If( IsExe64(), "FreeImage_Rotate", "_FreeImage_Rotate@16" ) ;
聽 聽 聽 LIB hLibToda esta informaci贸n est谩 en los foros
Actualmente trabajo con
Fivewin 15.09
Harbour 3.2.0
Visual Studio 2013
MariaDb/MySql
Gracias.
Fivewin 16.11
Harbour 3.2.0
Visual Studio 2015 community
MariaDb/MySql
Ing. MSc. Luis Duque
http://www.accasoft.net
Harbour 3.2.0
Visual Studio 2015 community
MariaDb/MySql
Ing. MSc. Luis Duque
http://www.accasoft.net