load a image into xbrowse

load a image into xbrowse

Postby Silvio.Falconi » Thu Mar 10, 2022 12:10 pm

cDirImages := "bitmaps\simboli"

WITH OBJECT oApp:oGrid

WITH OBJECT oApp():oGrid:aCols[6]
:bStrImage := { || FIELD->E1 }
:aImgRect := { nil, nil, -40, nil }
END


but FIELD->E1 is a number and I have n that folder images name as 1.png,2.png....
Hiow I can load the image ?
I made :bStrImage := { ||cDirImages+ ltrim(str(FIELD->E1))+".png" } but not work
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: load a image into xbrowse

Postby karinha » Thu Mar 10, 2022 12:30 pm

Code: Select all  Expand view  RUN

// \SAMPLES\XBRIMAG3.PRG

#include "fivewin.ch"

function Main()

   local oWnd, oBrw, oFont, oBold

   USE WWONDERS NEW

   DEFINE FONT oFont NAME "TAHOMA"  SIZE 0,-12
   DEFINE FONT oBold NAME "VERDANA" SIZE 0,-13 BOLD

   DEFINE WINDOW oWnd TITLE "Image and Text in same cell"
   oWnd:SetFont( oFont )

   @ 0,0 XBROWSE oBrw OF oWnd DATASOURCE "WWONDERS" ;
      COLUMNS "NAME","DETAILS" COLSIZES 200, 250 ;
      LINES NOBORDER

   WITH OBJECT oBrw
      :nRowHeight := 200
      WITH OBJECT :aCols[ 1 ]
         :bStrImage     := { || FIELD->IMAGE }
         :oDataFont     := oBold
         :nDataStrAlign := AL_CENTER + AL_BOTTOM
         :nDataBmpAlign := AL_CENTER
         :aImgRect      := { nil, nil, -40, nil }
      END
      //
      :CreateFromCode()
   END
   oWnd:oClient   := oBrw

   oWnd:nHeight   := 700


   ACTIVATE WINDOW oWnd CENTERED
   RELEASE FONT oFont, oBold

return nil
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7834
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: load a image into xbrowse

Postby Silvio.Falconi » Thu Mar 10, 2022 2:01 pm

yes of course

but I use tdata
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: load a image into xbrowse

Postby nageswaragunupudi » Fri Mar 11, 2022 4:21 am

Code: Select all  Expand view  RUN
I made :bStrImage := { ||cDirImages+ ltrim(str(FIELD->E1))+".png" } but not work
 


Please try
Code: Select all  Expand view  RUN
:bStrImage := { ||cDirImages+ "\" + ltrim(str(FIELD->E1))+".png" }


but I use tdata

So?
Simply substitute FIELD->E1 with oDbf:e1

Code: Select all  Expand view  RUN
:bStrImage := { ||cDirImages+ "\" + ltrim(str(oDbf:E1))+".png" }
Regards

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

Re: load a image into xbrowse

Postby Silvio.Falconi » Fri Mar 11, 2022 8:51 am

thanks Rao
the png are smaller and go up the previous column
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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