Show a picture in a webapp

Hi,

what I want:
I want to show a picture/image on a webapp.
The webapp is running local on a microsoft server.
The images are saved in a child-folder of the “exe”.

I don’t want to use a webimagewell, because it is slow and so on.

I thought, I can use a htmlviewer. But under the nativepath, I can’t access the image with ". Neither from the absolute path, nor from the relative path.

How do you solve this?

Not so sure slowness of ImageViewer is evident. I would rather blame WebFile for being slower than a simple image fetch on a web space.

But you can use WebSDK HTMLArea instead of HTMLViewer.

What is the path of your webapp in the browser?
You don’t access the webapp resources as if they were in a local computer, but rather using the logical web server paths.

Make an /images folder under your localhost root wherever it is and put your images there. (In IIS your localhost root probably is c:/inetpub/www)

Then you should be able to load the image in the webimageviewer ,

imagesroot = “http://localhost/images/
image.URL = imagesroot + “myphoto.jpg”

or in the HTMLarea by using the image tag

The path is the IP of my app (standalone). I want to run it in our network over a specified port (that works fine).

the current port is “http://192.168.2.107:9416

That doesn’t wok for me :frowning:

That is precisely where the problem is. It may work fine, it works slow. WebFiles have to go through the app bottleneck to display, which takes time. On the other hand, using a URL is MUCH faster because Apache or IIs are optimized to serve files extremely rapidly and with a minimum of resources.

See https://forum.xojo.com/11860-speed-up-image-loading/0

Even if you want your app to work on a local network, you can set up MAMP or WAMP which will serve your pictures URLs on your own PC at http://192.168.2.107:80.

Yea, that’s what I try to do! Display an image over its path/url in a webhtmlview.

How can I use MAMP to display the images in a webHTML view?

[quote=227928:@Lars Lehmann]Yea, that’s what I try to do! Display an image over its path/url in a webhtmlview.

How can I use MAMP to display the images in a webHTML view?[/quote]

Install Mamp, then it provides a folder that will be the root of your server.Place the picture there. Then all you got to do is use
http://192.168.2.107/myPic.gif

In general, it is wise to have a subfolder containing pictures, such as http://192.168.2.107/images/myPic.gif