Displaying an image with xbrowse ( uwe )

Displaying an image with xbrowse ( uwe )

Postby Rick Lipkin » Tue May 31, 2011 1:46 pm

Uwe

I have seen your tools that will display an image with xBrowse .. I am trying to display part information and add a picture to a row and column.

I am using fwh 910 hoping that I can add a pic, gif, jpg, bmp to xBrowse .. or perhaps better yet .. if I have a link top the picture .. could I use a eval( codeblock ) to view the image in xBrowse ?

Code: Select all  Expand view

http://tewarehouse.com/core/media/media.nl?id=1399&c=640052&h=1a930fa87f162a5984cd&resizeid=-1&resizeh=75&resizew=75
 



http://tewarehouse.com/core/media/media ... resizew=75


Your help would be appreciated!

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Displaying an image with xbrowse ( uwe )

Postby ukoenig » Tue May 31, 2011 3:20 pm

Rick,

A question, do You need a Image-list ( all Fields are filled with Images )
or just displayed in one Column ?

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: Displaying an image with xbrowse ( uwe )

Postby Rick Lipkin » Tue May 31, 2011 3:34 pm

Uwe

Thanks for the quick reply .. I want to create a 6th column (last column) to insert the picture of the part .. here is my xbrowse code..

Thanks
Rick

Code: Select all  Expand view

 REDEFINE xBROWSE oLBX2                ;
       ARRAY aResults                    ;
       COLUMNS 1,2,3,4,5                 ;
       COLSIZES 150,70,300,70,50         ;
       HEADERS "Site",                   ;
               "Part",                   ;
               "Desc",                   ;
               "Price",                  ;
               "Qty"                     ;
       ID 121 of oGrps                   ;
       AUTOSORT AUTOCOLS FASTEDIT LINES CELL

       oLbx2:Desc:cDataType := "M"
 



Image
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Displaying an image with xbrowse ( uwe )

Postby nageswaragunupudi » Tue May 31, 2011 3:39 pm

How are you storing picture information in your data file or array?

If you are storing as image buffer, simply add that column like any other column.
XBrowse automatically recognizes it to be a picture and shows the picture, without any need to write any specific code.
Regards

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

Re: Displaying an image with xbrowse ( uwe )

Postby Rick Lipkin » Tue May 31, 2011 3:49 pm

Rao

The location of the file can be cached locally ( have to figure out how to copy it from the website ) or as a direct URL ..

The file location would be something like this :
cFILE := "c:\webcrawl\dbtmp\image.jpg"

or

cFILE := "http://tewarehouse.com/core/media/media.nl?id=1399&c=640052&h=1a930fa87f162a5984cd&resizeid=-1&resizeh=75&resizew=75"

Are you suggesting I can add either of those two values to my array like :

aLINE := { cURL,cITEM,cDESC,cPRICE,cQTY,cFILE }
SetRowHeight( oLbx2:Desc, aLine[ 3 ] )
AAdd( aResults, aLine )
oLbx2:Refresh()
oLbx2:GoBottom()

Thanks
Rick
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Displaying an image with xbrowse ( uwe )

Postby nageswaragunupudi » Tue May 31, 2011 4:08 pm

If the image is stored in a file then after usually defining the browse,
set
oBrw:aCols[ 6 ]:cDataType := "F".
Setting the datatype to "F" tells xbrowse not to display the contents of aLine[6] ( which is file name) as a character value, but to read the file and display the contents as an image.

Better way is this.
I guess you are reading the image buffer in to memory and then store it as a file.
You can skip this step.
Read the image buffer directly into aLine[ 6 ].
You do not have to specify any datatype to aCols[ 6 ].
When xbrowse tries to display the contents of aLine[6], it recognizes the value as a binary data representing image and automatically displays it as image.
Regards

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

Re: Displaying an image with xbrowse ( uwe )

Postby Rick Lipkin » Tue May 31, 2011 8:31 pm

Rao

I used your column suggestion and I did get the picture which I had manually saved as a file to my computer to work ..

Image

Just curious .. if I have a link to a picture .. is it possible to eval that in the pic column ?

http://tewarehouse.com/core/media/media ... resizew=75

Otherwise I will need to devise a way to copy the file under program control from the website and then show it as a picture file.

Any ideas ?

Thanks
Rick
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Displaying an image with xbrowse ( uwe )

Postby nageswaragunupudi » Wed Jun 01, 2011 12:17 am

XBrowse does not have inbuilt capability to read from a weblink.
Regards

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

Re: Displaying an image with xbrowse ( uwe )

Postby Rick Lipkin » Wed Jun 01, 2011 12:23 am

Rao

Thanks .. I am working on the logic to copy the file down to my computer during the 'crawl' .. found a VB script that works which I think I can easily adapt.

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Displaying an image with xbrowse ( uwe )

Postby ukoenig » Thu Jun 02, 2011 2:49 pm

Rick,

for a new Update, I added the Internet-Option, to read / fill a Directory-array
with Infos from my Homepage-picture Directory, to show the Images in xbrowse.

WinSCP download :
http://winscp.net/eng/download.php

reading about WinSCP
http://winscp.net/eng/docs/

includes a Scripting-language, Commandline-mode and is absolutely FREE.
Connect to Your Homepage ( Upload / Download ), sending Emails .....
You can include and deliver the Files with Your application.

After the Install, I used only 4 Files, copied to my Sub-directory => \Internet
after that, I uninstalled again.

1. WinSCP.exe => Graphical user interface
2. WinSCP.com => Batch file scripting and command-line interface
3. DragExt.dll
4. WinSCP.ger => German-language-file

Connecting to the Homepage using a SCRIPT ( Log-file Log.txt created ) :

@ 70, 20 BTNBMP oBtn2 OF oDlg5 ;
SIZE 120, 40 PIXEL ;
PROMPT " &Connect to Internet" FILE c_path + "\Bitmaps\Internet.bmp" 2007 ;
FONT oTxtfont LEFT ;
ACTION WaitRun( c_path + "\Internet\WinSCP.exe /console /script=copy.txt /log=log.txt > log.txt", 0", 0 )
oBtn2:cToolTip = { "Connect to " + CRLF + "Internet", "Internet-Connection", 1, CLR_BLACK, 14089979 }


Save Script ( connects to a Homepage ) as Copy.txt
( there is a Forum about Scripting )

option batch on
option confirm off
# open ftp://[USER]:[PASSWORD]@[DOMAIN]:[PORT] You can define a Start-directory in DOMAIN
open ftp://??????? : ???????@esc-engineering.de/software/Pictures/ : 21
# add the actions, what You want to do
close
exit


Features :

•Graphical user interface
•Translated into several languages
•Integration with Windows (drag&drop, URL, shortcut icons)
•All common operations with files
•Support for SFTP and SCP protocols over SSH-1 and SSH-2 and plain old FTP protocol
•Batch file scripting and command-line interface
•Directory synchronization in several semi or fully automatic ways
•Integrated text editor
•Support for SSH password, keyboard-interactive, public key and Kerberos (GSS) authentication
•Integrates with Pageant (PuTTY authentication agent) for full support of public key authentication with SSH
•Explorer and Commander interfaces
•Optionally stores session information
•Optionally supports portable operation using a configuration file in place of registry entries, suitable for operation from removable media

1. Connecting to the Homepage
2. Filling the Directory-Array

1. Connecting to my Homepage Image-directory

Image

2. The Connecting-defines

Image

Possible to define / select a Homepage as project.
You can define as many You like


Image

3. Connected to the Homepage, a Filemanager opens, to select Images, Create Directorys, copy Files .....

Image

4. Selecting the Directory of the stored / downloaded Images from Internet

Image

5. The Result in xBrowseshows the downloaded Images

Image

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: Displaying an image with xbrowse ( uwe )

Postby byron.hopp » Tue Jul 26, 2022 12:43 am

Thank you, this works great. I even have my program write the script file so it becomes dynamic. Works very well, and it is free. Your program can read the log file to make sure it is successful.
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Displaying an image with xbrowse ( uwe )

Postby nageswaragunupudi » Thu Jul 28, 2022 2:49 pm

nageswaragunupudi wrote:XBrowse does not have inbuilt capability to read from a weblink.


We can now read images from URLS automatically without any additional programming.

Code: Select all  Expand view
#include "fivewin.ch"

#define MANGOES "https://img.huffingtonpost.com/asset/5c1225351f0000f00626a771.jpeg?ops=scalefit_630_noupscale"
#define APPLES  "https://cdn.images.express.co.uk/img/dynamic/109/590x/Apple-links-587431.jpg"
#define GRAPES  "https://img-aws.ehowcdn.com/350x235p/s3-us-west-1.amazonaws.com/contentlab.studiod/getty/f36944f5be3843ddafebd89b1dca105f.jpg"
#define ORANGES "https://www.jesmondfruitbarn.com.au/wp-content/uploads/2016/10/Jesmond-Fruit-Barn-Oranges.jpg"

function Main()

   local aData := { { "MANGOES", MANGOES }, { "APPLES",  APPLES  }, ;
                    { "GRAPES",  GRAPES  }, { "ORANGES", ORANGES }  }

   XBROWSER aData SETUP ( oBrw:nRowHeight := 150, oBrw:aCols[ 2 ]:cDataType := "F" )

return nil
 


Image
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 48 guests