by nanoespinoza » Tue Nov 15, 2022 12:42 am
Estimado Antonio:
Efectivamente, el primer error, ya no se da, el segundo se presenta cuando intento insertar una imagen en el reporte, entiendo que la clase TUtilPrn usa FreeImage.dll (copie la última versión desde FHW2210).
Hice una revisión minuciosa y el error se genera como indique, al intentar insertar una imagen con formato .png o .jgp que se carga con el metodo SayImage de TUtilPrn.
Este el mensaje de error:
Stack Calls
===========
Called from: .\source\classes\IMAGE.PRG => LOADFREEIMAGE( 505 )
Called from: .\source\classes\IMAGE.PRG => FILOADIMG( 325 )
Called from: .\source\classes\IMAGE.PRG => TIMAGE:DEFINE( 95 )
Called from: c:\sicef_desarrollo\bin\Utilprn.prg => TUTILPRN:SAYIMAGE( 0 )
Called from: c:\sicef_desarrollo\bin\Sicefwin.prg => TREPORTEFECHA:LINEAS( 0 )
Called from: c:\sicef_desarrollo\bin\Sicefwin.prg => TREPORTEFECHA:NEW( 0 )
Called from: c:\sicef_desarrollo\bin\Sicefwin.prg => (b)PREPARAREP( 0 )
Called from: .\source\function\MSGRUN.PRG => (b)MSGRUN( 47 )
Called from: .\source\classes\DIALOG.PRG => (b)TDIALOG:TDIALOG( 97 )
Called from: => TDIALOG:DISPLAY( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1200 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 307 )
Called from: .\source\function\MSGRUN.PRG => MSGRUN( 54 )
Called from: c:\sicef_desarrollo\bin\Sicefwin.prg => PREPARAREP( 0 )
Called from: c:\sicef_desarrollo\bin\Sicefwin.prg => (b)INICIO( 0 )
Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE( 1810 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 1073 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1847 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 2135 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3689 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1114 )
Called from: c:\sicef_desarrollo\bin\Sicefwin.prg => INICIO( 0 )
Este el método SayImage
METHOD SayImage( nArriba,nIzq,nAncho,nAlto,xImage,lImage,lPage,nRaster ) CLASS TUtilPrn
Local xCor := {},yCor := {},yyCor := {}
local hDib, hPal, hBmp
DEFAULT lImage := .F. ,;
lPage := .F. ,;
nArriba := 0.5,;
nIzq := 0.5 ,; // medio cm. para margenes de PAGE
nAncho := 0,;
nAlto := 0
if nAncho <= 0
nAncho := 5
endif
if nAlto <= 0
nAlto := 5
endif
xCor := ::oPrinter:Cmtr2Pix( nArriba,nIzq )
yCor := ::oPrinter:Cmtr2Pix( nAncho,nAlto )
IF lPage
yCor[1] := ::oPrinter:nHorzRes() - xCor[2]*2 // Restando lo mismo cms para margenes
yCor[2] := ::oPrinter:nVertRes() - xCor[1]*2
// ?yCor[2],::oPrinter:nVertRes() ,xCor[1] // Depuracion
ENDIF
IF lImage
* se for jpg
xBmp := timage():define( , ximage ,::oPrinter )
::oPrinter:SayImage( xCor[1],xCor[2], xbmp , yCor[1] ,yCor[2],nRaster )
DeleteObject( xBmp )
ELSE
* se for BMP
::oPrinter:SayBitmap(xCor[1],xCor[2],xImage, yCor[1],yCor[2],nRaster )
ENDIF
RETURN NIL
Saludos
Fernando Espinoza A.