FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Project : Programming a Image-viewer with xBrowse
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Project : Programming a Image-viewer with xBrowse
Posted: Sun Apr 24, 2011 11:39 AM
Andrés,

I added many new Functions for a new Update.
I'm still working on my Solution for a quick Image-search.
As soon it is working, the new Release 1.5 will be ready for Download.

Some new Functions added to => ImageView Release 1.5 :



Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: Project : Programming a Image-viewer with xBrowse
Posted: Sun Apr 24, 2011 11:45 PM
Hi everyone.

Reading from Rao on this same thread, xbrowse should be able to display images directly from an .adt table holding an image on a Bianry field. This is not working for me:
Application
===========
Path and name: F:\mp\patients.Exe (32 bits)
Size: 2,598,400 bytes
Time from start: 0 hours 0 mins 4 secs
Error occurred at: 24/04/2011, 19:37:15
Error description: Error BASE/1076 Argument error: >=
Args:
[ 1] = U
[ 2] = N 0

Stack Calls
===========
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:ADJUST(8363)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:ADJUST(958)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:INITIATE(856)
Called from: => __OBJSENDMSG(0)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => OSEND(219)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => ASEND(197)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE(657)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(917)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)


Here is my code:
Code (fw): Select all Collapse
   REDEFINE XBROWSE ::oGrid ;
             HEADER 'sec','Contrato','Seguro','Efectivo','Expiración', ;
                    'Apellidos, Nombres' ,'Tarjeta';
            COLUMNS 'seq','contract','insurance','effdate','expdate',;
                    {|| ALLTRIM( (::cAlias)->inslname ) + ' ' + (::cAlias)->insfname },'image';
              SIZES 35, 140, 80, 70, 70, 200, 100;
            JUSTIFY 2, 0, 0, 2, 2, 0, 0;
                 ID 103 ;
                 OF ::oDlg ;
              ALIAS ::cAlias;
        ON DBLCLICK EVAL( bUpdate ) ;
          ON CHANGE ::change() ;
               WHEN ! lEdit


Field "image" above is an .adt table type "Binary". It currently holds an image. It is visible when browsing the table with Arc32, but xbrowse breaks. I'm thinking that perhaps I'm missing something?

Please help,


Reinaldo.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Project : Programming a Image-viewer with xBrowse
Posted: Mon Apr 25, 2011 04:25 AM
Mr. Reinaldo,

It should normally work. Example is xbradt.prg in the samples folder. Incidentally ADT has another fieldtype "Image". When the field type is "Image", xbrowse sets the columns cDataType as "P" and treats the column's value as image buffer.

In any case, even without the programmer mentioning anything, any character value, if it is binary and if it is a valid image buffer, xbrowse is expected to display the contents as Image.

For example, if a memo field contains valid text in one row and image buffer in another row, xbrowse should display the first row as memo text and second row as image.

In the above sample, the code is breaking at line no. 8363. The code at this line is :
Code (fw): Select all Collapse
   if ValType( tmp := ::Value ) == 'C' .and. IsBinaryData( tmp )
      if FITypeFromMemory( tmp ) >= 0
         ::cDataType    := 'P'
      endif
   endif

It seems FiTypeFromMemory( <fieldvalue> ) is returning NIL for whatever reason.
Can you please modify the code as :
Code (fw): Select all Collapse
if IfNil( FITypeFromMemory( tmp ), -1 ) >= 0

and advise if you are still getting runtime error?

Please also set adequate column width and row height to accommodate the display of the picture.
Regards



G. N. Rao.

Hyderabad, India
Posts: 632
Joined: Thu Jan 19, 2006 10:45 AM
Re: Project : Programming a Image-viewer with xBrowse
Posted: Mon Apr 25, 2011 05:46 AM

Sorry Owe, do you put the download here or in other place?
Thanks

Saludos



Andrés González desde Mallorca
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Project : Programming a Image-viewer with xBrowse
Posted: Mon Apr 25, 2011 06:51 AM

The Download You can find here :

viewtopic.php?f=3t=21371

Best Regards
Uwe :lol:

&

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion