Problem with a Combobox

Problem with a Combobox

Postby Silvio.Falconi » Fri Feb 15, 2019 9: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

Image

Probable not read the image is into aServizi /2field

I have the images on .\images\servizi

Combobox run with png files ?
Last edited by Silvio.Falconi on Sat Feb 16, 2019 10:54 am, edited 2 times in total.
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: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with a Combobox

Postby Silvio.Falconi » 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 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: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with a Combobox

Postby nageswaragunupudi » Sat Feb 16, 2019 5:32 pm

Combobox supports bmp files only. Not png files.
Regards

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

Re: Problem with a Combobox

Postby Silvio.Falconi » Sat Feb 16, 2019 5:54 pm

ooopppss When.... this feature ?
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: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with a Combobox

Postby Silvio.Falconi » 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 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: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with a Combobox

Postby ukoenig » Tue Feb 19, 2019 5: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Problem with a Combobox

Postby Silvio.Falconi » 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: Select all  Expand view

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 )
Image


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

Image
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: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with a Combobox

Postby Silvio.Falconi » 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

Image

It seem run Good ...thanks Mr Uwe!!!!
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: 6849
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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