Displaying image in a label

I want to show an image in a label field from a field value. The field value could either be a URL to an image (www.mydomain.com/images/image1.gif) or a file link to an image (c:\temp\image1.gif)

I tried to use HTML in the label field as

<img src="%%URL%%">

But it shows only a broken image

Please shed some lights.

Thanks
Hameed

You can use as url:
media:/// (the 3 ‘/’ are correct!)
or
http://

File urls will likly not work when the user is running a Servoy Client on his system and the file is not there.

See also the crm demo for use of images in html

Thanks for that. I got it working. It’s great.

What I have acheived here is as follows:
I have a field for image_file_name which stores the name of the image for that record.
I am storing all the image files in a directory under Tomcat root folder.
Then in the Detail Layout I have a label showing the html with the following code:

<html>
  <head>
    
  </head>
  <body>
    <img src="%%globals.url%%%%file_name%%" width="150">
  </body>
</html>

where globals.url is set to something like “http://127.0.0.1:8080/MyImages/

I am displaying the image with the width=“150” and I want the height to be automatically
proportionally adjusted (like many web browser do) instead of squashing the image

Is there a way to handle this?
Please give me an idea

Thanks a lot.
Hameed

First of all do you know there is a serverURL tag availeble which returns the web address of the Servoy server?
As far as I know the html renderer does the same as a browser, does IE for example the scaling as you said? (I thought it does scale if you specify width and heigth)

Hi Jan,

Thanks for your reply. I was aware of %%serverURL%% tag which is available when I go to write the text property for the lable. But I just used the manual link. Thanks for reminding that.

I have just tested the IE 6 for tag with a contant with and it has done the resize of image proportionally automatically.

Thanks

Added to feature list