Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
set the filename of image myImage to "http://mysite.com/myimage.png"
However, this doesn't load images every time. Also, how to save that image in the stack so that if I compile app with that image (set as source of image holder) it doesn't dissapear (if there is no internet connection)?
Obviously "import paint from file..." only works with local files.
You need to do download the image to your machine first like this:
...
put url "http://mysite.com/myimage.png" into url("binfile:" & speciafolderpath("documents") & "/myimage.png")
...
And use that new local file.
set the text of img 1 to url "http://www.domain.com/images/img.png"
That will load the image content from the web directly into the image object. Since the the image is now imported rather than referenced, saving the stack will save the image as well.
I'm having troubles trying to load images from internet. I use this code on a button:
If this only fails some of the time, the most likely reason is an incorrect URL. You might get more information about the cause of the error if you check the result after issuing the command:
Just one more dumb question (I'll ask here so I don't open million new topics):
How do I set filename of image to other image?
Let's say I have imported image in stack and I want to set the filename of another image to be the same as the image that is imported?
croivo wrote:How do I set filename of image to other image?
Let's say I have imported image in stack and I want to set the filename of another image to be the same as the image that is imported?
The filename is only used to refer to a file on disk. If an image is already imported, it has no filename, it is now a part of the stack. The content of an image is its "text" property. So to put the content of an imported image into another image: