FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with a Combobox
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Problem with a Combobox
Posted: Fri Feb 15, 2019 09:11 AM
I have an array of 3 items : name,image,struttura

AaDd(alist_temp,{ alltrim(SZ->NAME),alltrim(SZ->IMAGE), alltrim(SZ->struttura) })


and for show a combo I made

@ 53, 55 COMBOBOX aGet[5] VAR nServizio ITEMS ArrTranspose( aServizi )[ 1] ;
OF oDlg SIZE 100, 120 PIXEL FONT oFont WHEN aGet[2]:nOption=2 .or. aGet[2]:nOption=3
BITMAPS ArrTranspose( aservizi )[ 2]

But it show this



Probable not read the image is into aServizi /2field

I have the images on .\images\servizi

Combobox run with png files ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with a Combobox
Posted: Sat Feb 16, 2019 10:51 AM

any solution please ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with a Combobox
Posted: Sat Feb 16, 2019 05:32 PM

Combobox supports bmp files only. Not png files.

Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with a Combobox
Posted: Sat Feb 16, 2019 05:54 PM

ooopppss When.... this feature ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with a Combobox
Posted: Mon Feb 18, 2019 12:39 PM

How I can simulate a combobox with Png because I have the record to select with pngs

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Problem with a Combobox
Posted: Tue Feb 19, 2019 05:07 PM
You can convert PNG to BMP for the combobox-usage

viewtopic.php?f=3&t=35547&p=211638&hilit=TransformBitmap#p211638

hBmp := FW_ReadImage( nil, "Lock.png" )[ 1 ]
hNew := FW_TransformBitmap( hBmp, NIL, 0.08 ) // resize for combobox usage
FW_SaveImage( hNew, "Lock.bmp" ) // to be used


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: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with a Combobox
Posted: Wed Feb 20, 2019 12:06 AM
Uwe,
This thing is very interesting. I store files in an archive but it is managed by the user and the files can be of various types.
Generally, the end user could load png or even gif, jpg and Bmp.
How can I check if the files are png or are these functions good for any format?
and then I could create temporary images and then delete them every time?

aTest
Code (fw): Select all Collapse
aElementiBmp:={ }  //new array
cFoldertemp:=".\bitmaps\mini\"
For n= 1 to Len(aElementi)  //on aElementi there are a fields where I save file img

                   Converti_Immagine_Bmp(ArrTranspose( aElementi )[ 3],cFolderTemp,"temp_"+alltrim(str(n)))

aadd(aElementiBmp,"temp_"+alltrim(str(n)))

next
//-------------------------------------------------------------------------------------//
Function Converti_Immagine_Bmp(cFile,cFolderTemp,cNewName)
   Local ext:=".Bmp"
   Local nResize:=0.08
   Local hBmp := FW_ReadImage( nil, cFile )[ 1 ]
   Local hNew := FW_TransformBitmap( hBmp, NIL, nResize ) // resize for combobox usage
     FW_SaveImage( hNew, cFolderTemp+cNewName+ext )
 Return   cFolderTemp+cNewName+ext



this is the result (probable error )



I check and I saw I have only 4 images original

1 png of 312x315
2 png 135X132
3 png 165x161
4 png 363X350

why I have 4 smaller bmp ?
and if you see good there is black back ( transparent is not converted to white)


But on the combo I have this . This conversion could work if we could only convert all the images in the same format

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with a Combobox
Posted: Wed Feb 20, 2019 12:51 AM
Sorry My error ...now it seem run ok
I converte all images to 72X72
and I have this result with nresize --->0.30



It seem run Good ...thanks Mr Uwe!!!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion