PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → How to add an image field on a table in "Edit in place" mode
How to add an image field on a table in "Edit in place" mode
Iniciado por Martin M., out., 26 2020 9:26 AM - 5 respostas
Publicado em outubro, 26 2020 - 9:26 AM
Hello, I have the following doubt.
I have an "image" field in a data file, which through a form I can add a photo (for example, a customer's photo).
I do this with the following code:

// select an image
sImagePath is string = fImageSelect("","","")
IF sImagePath <> "" THEN
IMG_Foto = sImagePath
IMG_Foto..Modified = True
END

the problem is that I NEED to add that same photo in a table "EDIT IN PLACE", by means of a button, which I put in a container, but I cannot add it in any way, (the field is empty once I decide to save). no data remains.
Does anyone know what would be the correct code in this case?
From already thank you very much
Membro registado
5 mensagems
Publicado em outubro, 26 2020 - 4:48 PM
Hi,

you just forgot to mention the Table's name in your code ...

Table.IMG_FOTO = ... is the most simple way if Table.IMG_FOTO is the column's name ..

Table[Table].IMG_FOTO = ... more precise
Publicado em outubro, 28 2020 - 11:41 PM
Thanks for the answer.
It doesn´t work
It works in a form mode, but in a edit in place table don´t.
Any other suggestion?
Publicado em outubro, 28 2020 - 11:44 PM
if i select an image then the image stores in the table, but when i click on validate button didn´t record.
i back to the table again and all the records are stored, but not the image
Membro registado
5 mensagems
Publicado em novembro, 01 2020 - 10:53 AM
Hi, I did a test and indeed, it's not that easy to add an image this way, imho it's even impossible. But that's not a big problem, it can be solved by (making and) identifying the record and adding the image by HModify(...). I made an example project www.syspredl.com/datafiles/WD25_ImageToTable.zip for you. You can downlöoad and test.

--
Gunter Predl
paypal@windev.at
Publicado em novembro, 12 2020 - 4:26 AM
Guenter escribío:
Hi, I did a test and indeed, it's not that easy to add an image this way, imho it's even impossible. But that's not a big problem, it can be solved by (making and) identifying the record and adding the image by HModify(...). I made an example project www.syspredl.com/datafiles/WD25_ImageToTable.zip for you. You can downlöoad and test.

--
Gunter Predl
paypal@windev.at


Hi! and thanks for the answer.
I did a test on your example, and i must say thanks for take the time.
But, i have another problem:
The image scale is not the same that i load and put on the record to see later.
For example, i choose an image that is 1920x1080, and the image recorded is 8 times smaller. I can´t see the details.
What i did wrong?
The idea to add a record that contains an image in my project, is to see a ticket from paids, and i cannot see the details on the image because is smaller and the image displays without the correct resolution.
Try the options for display image, HQ resolution, etc. But the problem seems to be the image that was stored.
I use your example to try this, and this is what happened to me.
And, if you are glad to find a solution, i add other doubt;
If i want to display te image from double click for example, what command shall i use? to display enlarge the stored image, in a popup window, or has windev an image viewer? something like that.
Thanks for the time. And thanks again to help me finding a solution.
Martin