JPG images in an xBrowse

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

JPG images in an xBrowse

Post by PeterHarmes »

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
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: JPG images in an xBrowse

Post by Rick Lipkin »

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

oLbx:aCols[ 7 ]:cDataType := "F"
 
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: JPG images in an xBrowse

Post by ukoenig »

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.
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Post by PeterHarmes »

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

Re: JPG images in an xBrowse

Post by ukoenig »

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.
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Post by PeterHarmes »

Uwe,

Looking forward to the update :)

Pete
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: JPG images in an xBrowse

Post by nageswaragunupudi »

Mr Peter

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

You need to add just One Line of code

Code: Select all

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
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Post by PeterHarmes »

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

Post by PeterHarmes »

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?
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: JPG images in an xBrowse

Post by nageswaragunupudi »

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: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: JPG images in an xBrowse

Post by nageswaragunupudi »

Please try this example program:

Code: Select all

#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
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: JPG images in an xBrowse

Post by PeterHarmes »

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

Best regards,

Pete
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: JPG images in an xBrowse

Post by ukoenig »

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.
Post Reply