Page 1 of 1
					
				Display an image
				Posted: Tue Oct 27, 2020 6:46 pm
				by AMpos
				I am working in an easy proyect. I have opened a window, and wat to show an image. Currently I am making it with a ImageGadget and the bindevent things.
I find it a bit complicated (although I have it working).
Is there an easy way to display an image? Something like
Code: Select all
<img border="0" src="gfx/black.jpg" width="400" height="200">
I dont plan to do anything with this image, it is just a background image and it is always the same.
 
			 
			
					
				Re: Display an image
				Posted: Tue Oct 27, 2020 8:16 pm
				by munfraid
				You can pass html to the Textgadget. 
Code: Select all
OpenWindow(0, 0, 0, 800, 600, "Background picture")
TextGadget(0, 0, 0, 800, 600, "<img src='https://cdn.pixabay.com/photo/2016/02/19/11/19/computer-1209641_960_720.jpg'>")
 
			 
			
					
				Re: Display an image
				Posted: Tue Oct 27, 2020 9:53 pm
				by AMpos
				I have the picture saved at "gfx/back.jpg"
Code: Select all
TextGadget(-1, 8, 90, 480, 120, "<img src='/gfx/event.jpg'>")
does work when running in local, but after uploading it to the web, it does not find the image.
This is my site folder:
-index.htm
-index.js
-[spiderbasic/]
-[gfx/]
--gfx/event.jpg
Any hint?
Notice that if I put the full url as 
http://www.mysite.com/gfx/event.jpg it works online, but I have to use this /gfx/event.jpg if possible.
 
			 
			
					
				Re: Display an image
				Posted: Tue Oct 27, 2020 10:11 pm
				by Peter
				do you define the gfx folder as resources directory in the Create App - Dialog?

 
			 
			
					
				Re: Display an image
				Posted: Tue Oct 27, 2020 10:59 pm
				by AMpos
				Again, thank you, dude.