JPG images in an xBrowse

JPG images in an xBrowse

Postby PeterHarmes » Tue Jul 30, 2013 3:57 pm

Hi,

I have a table containing a column that is populated with the path & filename of a JPG file. Is it possible to have an xBrowse that shows a thumbnail of this image in one column along with additional columns from the table?

I think I can remember Uwe creating a tool that could do this, is this correct?

Best regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Postby Rick Lipkin » Tue Jul 30, 2013 6:07 pm

Peter

Try this .. aCols[7] represents the column you wish to view the picture .. add this line after you define the browse .. "F" defines the column as "file".

Rick Lipkin

Code: Select all  Expand view

oLbx:aCols[ 7 ]:cDataType := "F"
 
User avatar
Rick Lipkin
 
Posts: 2634
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: JPG images in an xBrowse

Postby ukoenig » Wed Jul 31, 2013 11:21 am

Pete,

there will be a new tool in a short time, to show
a image / text - combination.
Is that the solution, You are looking for ?

Image

Image

Best Regards
Uwe :?:
Last edited by ukoenig on Mon Aug 05, 2013 6:25 pm, 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: JPG images in an xBrowse

Postby PeterHarmes » Mon Aug 05, 2013 8:09 am

Hi Rick/Uwe,

Rick - thanks, I will have a look and see if I can get the browse to work with your suggestion.

Uwe - Yes that is what I want - the first column could be the thumbnail/image, the following columns would be columns from the same row in the table.

Thanks

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Postby ukoenig » Mon Aug 05, 2013 8:15 am

Pete,
the new tool is nearly finished and shows the needed results.
I still want to add some extras, before adding a new post for download.

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

Re: JPG images in an xBrowse

Postby PeterHarmes » Mon Aug 05, 2013 8:56 am

Uwe,

Looking forward to the update :)

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Postby nageswaragunupudi » Mon Aug 05, 2013 8:57 am

Mr Peter

This is EXTREMELY SIMPLE.
Just follow Mr Rick's suggestion.

You need to add just One Line of code
Code: Select all  Expand view

oBrw:aCols[ n ]:cDataype := "F"
 

where n is the column number of the browse showing the field containing the filename
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: JPG images in an xBrowse

Postby PeterHarmes » Mon Aug 05, 2013 9:23 am

Setting the cDatatype works well

Thanks once again
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Postby PeterHarmes » Mon Aug 05, 2013 10:35 am

This seems to work when i'm browsing a table, but if I create an array of filenames and browse the array, I just get an empty column - does it work on arrays?
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Postby nageswaragunupudi » Mon Aug 05, 2013 12:47 pm

Work on all.
Please make sure two things
value should be a valid path
and that column's cDataType should be set to "F"
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: JPG images in an xBrowse

Postby nageswaragunupudi » Mon Aug 05, 2013 2:01 pm

Please try this example program:
Code: Select all  Expand view
#include "FiveWin.ch"
#include "xbrowse.ch"

function Main()

   local oDlg, oBrw, aData := {}

   AEval( DIRECTORY( "c:\fwh\bitmaps\pngs\*.png" ), { |a| ;
      AAdd( aData, { a[ 1 ], "c:\fwh\bitmaps\pngs\" + a[ 1 ] } ) } )

   DEFINE DIALOG oDlg SIZE 500,400 PIXEL
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      DATASOURCE aData COLUMNS 2, 1 ;
      HEADERS "
Image", "Name" ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      :aCols[ 1 ]:cDataType      := "
F"
      :aCols[ 1 ]:nDataBmpAlign  := AL_CENTER
      :nStretchCol   := 2
      //
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED

return nil


Result:
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: JPG images in an xBrowse

Postby PeterHarmes » Mon Aug 05, 2013 2:25 pm

Thanks for the example and it pointed out my glaringly obvious mistake.

Best regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Postby ukoenig » Mon Aug 05, 2013 6:26 pm

Pete,
the 2. style, using ARRAYS
1. full path displayed in a tooltip
2. three info-fields
3. filename displayed vertical
4. change image on right mouseclick

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests