Page 1 of 1

search a image

Posted: Mon Jan 20, 2025 9:23 am
by Silvio.Falconi
I wish search a folder into a database to change an Image from a combobox

@ 152, 10 COMBOBOX aGet[1] VAR cAzienda ITEMS aAziende SIZE 370,90 PIXEL OF oDlg;
ON CHANGE ChangeComboBoxItem(aGet[1], oBmp01, oAziende)

Code: Select all | Expand


FUNCTION ChangeComboBoxItem(oComboBox, oBmp01, oAziende)
    LOCAL cSelectedItem := oComboBox:GetText() 
    LOCAL cDir01, cImagePath


    IF oAziende:Seek(cSelectedItem)
        cDir01 := oAziende:Dir01

        cImagePath := ".\"+cDir01 + "\immagini\logo.bmp"

        // Verifica se il file immagine esiste
        IF File(cImagePath)
            oBmp01:LoadBmp(cImagePath)
        ELSE
            MsgInfo("Immagine non trovata: " + cImagePath, "Errore")
        ENDIF
    ELSE
        MsgInfo("Elemento non trovato nel database: " + cSelectedItem, "Errore")
    ENDIF

    RETURN NIL

If found the dir01 as Dat2016 then not found the image (File(cImagePath)) but the image is on that folder DAT2016\immagini\logo.bmp

where is the error ?

Re: search a image

Posted: Mon Jan 20, 2025 11:57 am
by Antonio Linares
What is the final value for cImagePath ?

Re: search a image

Posted: Mon Jan 20, 2025 12:26 pm
by Silvio.Falconi
Antonio Linares wrote: Mon Jan 20, 2025 11:57 am What is the final value for cImagePath ?
Image

Re: search a image

Posted: Mon Jan 20, 2025 12:27 pm
by Silvio.Falconi
sorry my mistake
it was login.bmp no logo.bmp
sorry I'm not feeling well these days

Re: search a image

Posted: Mon Jan 20, 2025 12:49 pm
by Antonio Linares
never mind my friend :)