Page 2 of 3

Re: How to display TIF picture ?

Posted: Sat Nov 21, 2009 5:39 pm
by Ricci
gfilatov wrote: I have a working demo application compiled by HMG Extended Edition which is included in archive.
Is it works for you :?:
Yes, your EXE is working

Re: How to display TIF picture ?

Posted: Sat Nov 21, 2009 6:17 pm
by gfilatov
Ricci wrote:
gfilatov wrote:[
and also you'll need freeimage.lib was taken from freeimage.dll contribution.

I have a working demo application compiled by HMG Extended Edition which is included in archive.
Is it works for you :?:
Where do i have to put the Lib to? Because i get this error log (only the beginning and end

Harbour 2.0.0beta3 (Rev. 12765)
Copyright (c) 1999-2009, http://www.harbour-project.org/
D:/hmg/harbour/lib/libhbfimage.a(fi_wrp.o):fi_wrp.c:(.text+0x17f): undefined reference to `_imp__FreeImage_Paste@20'
D:/hmg/harbour/lib/libhbfimage.a(fi_wrp.o):fi_wrp.c:(.text+0x31f): undefined reference to `_imp__FreeImage_Copy@20'
...
D:/hmg/harbour/lib/libhbfimage.a(fi_winfu.o):fi_winfu.c:(.text+0x4c2): undefined reference to `_imp__FreeImage_GetBits@4'
D:/hmg/harbour/lib/libhbfimage.a(fi_winfu.o):fi_winfu.c:(.text+0x4d0): undefined reference to `_imp__FreeImage_GetInfoHeader@4'
collect2: ld returned 1 exit status
hbmk2: Error: Running linker. 1
gcc.exe test.o hbmk_j37rn7.o D:/hmg//resources/minigui.o -mwindows -Wl,--start-group -lminigui -lhbmysql -lmysql -lcrypt -ledit -leditex -lgraph -lini -lreport -lhbwin -lhbziparc -lhbmzip -lmsvfw32 -lvfw32 -lsddodbc -lrddsql -lsddmy -lhbodbc -lodbc32 -lhbhpdf -lhbvpdf -lhbmemio -lhbsqlit3 -lsqlite3 -lhbfimage -lhbpgsql -lpq -lhbtip -lhbct -lhbmisc -lhbnetio -lxhb -lhbextern -lhbdebug -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -otest.exe -LD:/hmg/harbour/lib -LD:/hmg//lib
Ricci,

I've adapted this sample for HMG 3.0 already.
Take a look for attached working demo with project files and needed library ;)

Re: How to display TIF picture ?

Posted: Sat Nov 21, 2009 6:39 pm
by Ricci
gfilatov wrote: Ricci,
I've adapted this sample for HMG 3.0 already.
Take a look for attached working demo with project files and needed library ;)
Grigory, thank you so much ... now it´s my time to implement it in my program. You will get it message, when it´s ready for viewing.

Ricci

Re: How to display TIF picture ?

Posted: Sat Nov 21, 2009 7:54 pm
by Ricci
gfilatov wrote: I've adapted this sample for HMG 3.0 already.
Take a look for attached working demo with project files and needed library ;)
Hi, Grigory !

Well it works in my program, a lot of work to do ....

One question: you use the function FI_WinDraw( ) to draw the loaded grafic.

Is there any documentation about this function or others i may need ?

For example: how will i clear the screen area of the picture before i display the next ?


Thanks for your help ... Ricci

Re: How to display TIF picture ?

Posted: Sat Nov 21, 2009 8:07 pm
by gfilatov
Ricci wrote: One question: you use the function FI_WinDraw( ) to draw the loaded grafic.

Is there any documentation about this function or others i may need ?

Thanks for your help ...
Ricci,

I guess that the documentation is absent. :?
There is a self-documented source code only (look at below) ;)

Code: Select all

* -------------------------------------------------------------------------- */
/* Draw an image in a window Box -------------------------------------------- */
/* -------------------------------------------------------------------------- */

/* implementation: int scanlines = FI_WinDraw( FIBITMAP *dib, HDC hDC, nTop, nLeft, nBottom, nRight ); */
HB_FUNC( FI_WINDRAW )
{
   if( hb_pcount() == 6 &&
       hb_parinfo( 1 ) & HB_IT_POINTER &&
       hb_parinfo( 2 ) & HB_IT_NUMERIC &&
       hb_parinfo( 3 ) & HB_IT_NUMERIC &&
       hb_parinfo( 4 ) & HB_IT_NUMERIC &&
       hb_parinfo( 5 ) & HB_IT_NUMERIC &&
       hb_parinfo( 6 ) & HB_IT_NUMERIC
     )
   {
      FIBITMAP * dib;
      HDC hDC;
      RECT rcDest;
      int scanlines;

      /* Retrieve parameters */
      dib  = ( FIBITMAP * ) hb_parptr( 1 );
      hDC  = HB_ISNUM( 2 ) ? ( HDC ) ( HB_PTRUINT ) hb_parnint( 2 ) : ( HDC ) hb_parptr( 2 );
      rcDest.top    = hb_parni( 3 );
      rcDest.left   = hb_parni( 4 );
      rcDest.bottom = hb_parni( 5 );
      rcDest.right  = hb_parni( 6 );

      /* run function */
      SetStretchBltMode( hDC, COLORONCOLOR );

      scanlines = StretchDIBits(hDC, rcDest.left,
                                     rcDest.top,
                                     rcDest.right-rcDest.left,
                                     rcDest.bottom-rcDest.top,
                                     0, 0, FreeImage_GetWidth(dib), FreeImage_GetHeight(dib),
                                     FreeImage_GetBits(dib), FreeImage_GetInfo(dib),
                                     DIB_RGB_COLORS, SRCCOPY);

      /* return value */
      hb_retni( scanlines );
   }
   else
   {
      /* Parameter error */
      hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
         HB_ERR_FUNCNAME, 6,
         hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ),
         hb_paramError( 4 ), hb_paramError( 5 ), hb_paramError( 6 ) );
   }
}


Re: How to display TIF picture ?

Posted: Sat Nov 21, 2009 8:14 pm
by Ricci
gfilatov wrote:
Ricci wrote: One question: you use the function FI_WinDraw( ) to draw the loaded grafic.

Is there any documentation about this function or others i may need ?

Thanks for your help ...
Ricci,

I guess that the documentation is absent. :?
Does that mean we have a nice "libhbfimage.a" but no one knows how to use it anymore :?:
I cannot believe it.

Re: How to display TIF picture ?

Posted: Sat Nov 21, 2009 8:21 pm
by gfilatov
Ricci wrote:
gfilatov wrote:
Ricci wrote: One question: you use the function FI_WinDraw( ) to draw the loaded grafic.

Is there any documentation about this function or others i may need ?

Thanks for your help ...
Ricci,

I guess that the documentation is absent. :?
Does that mean we have a nice "libhbfimage.a" but no one knows how to use it anymore :?:
I cannot believe it.
One clarification: you have a FreeImage Documentation at
http://downloads.sourceforge.net/freeim ... ge3130.pdf
:idea:

Re: How to display TIF picture ?

Posted: Sat Nov 21, 2009 10:24 pm
by Ricci
gfilatov wrote:One clarification: you have a FreeImage Documentation at
http://downloads.sourceforge.net/freeim ... ge3130.pdf
:idea:
Grigory,

I found out that only some functions a accessible through the libhbfimage.a .

:?: I wanted to clear the part of the window where the picture is displayed while browsing before the next one. Because when they don´t have the same size, they overlap.

I tried some of the functions in the documentation but most of them are not accessible, some need special data structures that are not implemented in HMG:
- FI_AllocateExT would be great, creating a bitmap, filling it with a color and then show it to overwrite the last picture. After that load the next picture and display it. But .. no way.
- I can use FI_Allocate and getting a bitmap filled black, but FI_FillBackground after that does not exist.

But the rest works very well ... only a little thing to finish :)

Enough for today

Re: How to display TIF picture ?

Posted: Sun Nov 22, 2009 7:13 pm
by Roberto Lopez
gfilatov wrote: I've adapted this sample for HMG 3.0 already.
Take a look for attached working demo with project files and needed library ;)
Nice sample. Thanks Grigory!

Re: How to display TIF picture ?

Posted: Sun Nov 22, 2009 10:03 pm
by Roberto Lopez
gfilatov wrote: I've adapted this sample for HMG 3.0 already.
Take a look for attached working demo with project files and needed library ;)
I'm asking your permission to include this sample in the next HMG test build.

TIA.