FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBrowse - adding cellimages from DBF or array
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
XBrowse - adding cellimages from DBF or array
Posted: Wed Mar 13, 2019 11:17 AM
Hello,

I tested a xBrowse-painting-function with the following requirements :
( maybe a buildin-function with the same result exists ? )


1. any image-format
2. cell-selection
3. cell-adjustment ( centered )
4. small images resized to cellsize
5. keeping the aspect ratio ( size calculated to fill the cell )
6. NO using of :AddBitmap
7. NO text visible only the image
8. reading the image-names from a DBF-field or array


testing different sizes and format



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.
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: XBrowse - adding cellimages from DBF or array
Posted: Wed Mar 13, 2019 01:37 PM
Uwe,

Not shure what function you are using, but I have this :
Code (fw): Select all Collapse
  @ 1,1 XBROWSE oBrw OF oDlg SIZE 330,430 PIXEL DATASOURCE "showpic" ;
      COLUMNS "pic1","pic2","pic3" COLSIZES 200, 200,200 ;
      CELL LINES NOBORDER


   WITH OBJECT oBrw
      :nRowHeight := 200
      WITH OBJECT :aCols[ 1 ]
         :bStrImage     := { || "r:\pictures\"+alltrim(showpic->pic1) }
         :oDataFont     := oBold
         :nDataStrAlign := AL_CENTER + AL_BOTTOM
         :nDataBmpAlign := AL_CENTER
         :aImgRect      := { nil, nil, -40, nil }
      END
      WITH OBJECT :aCols[ 2 ]
         :bStrImage     := { || "r:\pictures\"+alltrim(showpic->pic2) }
         :oDataFont     := oBold
         :nDataStrAlign := AL_CENTER + AL_BOTTOM
         :nDataBmpAlign := AL_CENTER
         :aImgRect      := { nil, nil, -40, nil }
      END
      WITH OBJECT :aCols[ 3 ]
         :bStrImage     := { || "r:\pictures\"+alltrim(showpic->pic3) }
         :oDataFont     := oBold
         :nDataStrAlign := AL_CENTER + AL_BOTTOM
         :nDataBmpAlign := AL_CENTER
         :aImgRect      := { nil, nil, -40, nil }
      END

      //
      :CreateFromCode()
   END
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: XBrowse - adding cellimages from DBF or array
Posted: Wed Mar 13, 2019 04:16 PM
Marc,

I added the test but with different results
1. No resize of small images only images > cellsize are resized.
2. A visible celltext

adding :lBmpStretch := .t. fills the cellarea but doesn't keep the aspect ratio



WITH OBJECT oBrw:aCols[ 5 ]
// :bStrImage := { || c_path1 + ALLTRIM(oCust:Image) }
// :nDataStrAlign := AL_CENTER + AL_BOTTOM
// :nDataBmpAlign := AL_CENTER


// My solution
:bPaintText := { | oCol, hDC, cData, aRect | ;
DRAWCELL( c_path1,oCol, hDC, cData, aRect ) }
// extra function
END

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.

Continue the discussion