XBrowse - adding cellimages from DBF or array

XBrowse - adding cellimages from DBF or array

Postby ukoenig » 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

Image

regards
Uwe :D
Last edited by ukoenig on Wed Mar 13, 2019 4:13 pm, edited 3 times 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: XBrowse - adding cellimages from DBF or array

Postby Marc Venken » Wed Mar 13, 2019 1:37 pm

Uwe,

Not shure what function you are using, but I have this :
Code: Select all  Expand view

  @ 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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1355
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: XBrowse - adding cellimages from DBF or array

Postby ukoenig » Wed Mar 13, 2019 4: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

Image

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 :roll:
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 28 guests