Page 1 of 1

Problem with a Combobox

PostPosted: Fri Feb 15, 2019 9:11 am
by Silvio.Falconi
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 ?

Re: Problem with a Combobox

PostPosted: Sat Feb 16, 2019 10:51 am
by Silvio.Falconi
any solution please ?

Re: Problem with a Combobox

PostPosted: Sat Feb 16, 2019 5:32 pm
by nageswaragunupudi
Combobox supports bmp files only. Not png files.

Re: Problem with a Combobox

PostPosted: Sat Feb 16, 2019 5:54 pm
by Silvio.Falconi
ooopppss When.... this feature ?

Re: Problem with a Combobox

PostPosted: Mon Feb 18, 2019 12:39 pm
by Silvio.Falconi
How I can simulate a combobox with Png because I have the record to select with pngs

Re: Problem with a Combobox

PostPosted: Tue Feb 19, 2019 5:07 pm
by ukoenig
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 :?:

Re: Problem with a Combobox

PostPosted: Wed Feb 20, 2019 12:06 am
by Silvio.Falconi
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

Re: Problem with a Combobox

PostPosted: Wed Feb 20, 2019 12:51 am
by Silvio.Falconi
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!!!!