Project : Programming a Image-viewer with xBrowse

Re: Project : Programming a Image-viewer with xBrowse

Postby ukoenig » 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 :

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Mon Apr 25, 2011 9:29 am, edited 1 time in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Project : Programming a Image-viewer with xBrowse

Postby reinaldocrespo » 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: Select all  Expand view  RUN
  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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Project : Programming a Image-viewer with xBrowse

Postby nageswaragunupudi » Mon Apr 25, 2011 4: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: Select all  Expand view  RUN
  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: Select all  Expand view  RUN
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
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Project : Programming a Image-viewer with xBrowse

Postby Andrés González » Mon Apr 25, 2011 5:46 am

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

Andrés González desde Mallorca
User avatar
Andrés González
 
Posts: 629
Joined: Thu Jan 19, 2006 10:45 am
Location: Mallorca

Re: Project : Programming a Image-viewer with xBrowse

Postby ukoenig » Mon Apr 25, 2011 6:51 am

The Download You can find here :

viewtopic.php?f=3&t=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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 37 guests

cron