Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 1 Jahr, 12 Monaten
Letzter Beitrag:
vor 1 Jahr, 12 Monaten
Beteiligte Autoren:
JP, Fabrice Harari

[WB21] - Display an image

Startbeitrag von JP am 27.06.2016 09:23

Hi All

Classic WebDev 21 site

I am trying to load a dynamic page which contains an image control. I want to programmatically assign an image to the control when the user chooses to load the page (there is a condition which determines the image to display).

I use Image_Control_Name = Full_path_and_name_to_image_file in the server initialization code of the page.

However the image does not display. What settings or options or other things do I need to set to make this work?




3 very important things for images:

1. in the image description, you need to choose the origin of the image properly (from the DB, from a directory, etc)
2. You also need to make sure that the image itself is in a SUBdirectory of your web site. If you don't, you'll have to modify permissions on your server to make it work when you deploy, thus lessening the security.
3. If you are in server code, you need to use a full path (windows style) to set your field, but if you are in browser code, you need to use a URL instead (as the browser doesn't know or have access to the server)

Best regards

von Fabrice Harari - am 27.06.2016 11:27
Fabrice, thanks for that. Where does one set the origin of the image? I see a drop down called "Type" which offers Static, Dynamic, From Database Path, From Database Memo, and Generated. Is this what you refer to? If so, which option is the one to use in order to load an image file from a disk folder?


von JP - am 27.06.2016 11:43

Success - I changed the image type (General tab) to Generated, then in the server initialization code set the path to the image file. Works well.


von JP - am 27.06.2016 15:40
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.