Page 1 of 1

import image in standalone

Posted: Tue Jul 08, 2014 6:38 am
by robm80
Is it possible to import an image in a standalone stack.
If yes what script?

thanks, Rob

Re: import image in standalone

Posted: Tue Jul 08, 2014 10:35 am
by keram
To import an image to a LC stack is possible, but if you mean standalone app then I'm almost sure that you can't.

Re: import image in standalone

Posted: Tue Jul 08, 2014 11:25 am
by Klaus
Hi Rob,

of course you can import an image into a standalone:
...
import paint from file "path/to/file.jpg"
...
which will, of course, NOT get saved, because it is a standalone 8)

You will need to save it before closing your app and "import" it again,
when the app starts the next time.


Best

Klaus

Re: import image in standalone

Posted: Tue Jul 08, 2014 11:51 am
by keram
Hi Klaus,

Good that you clarified it, at least to some extend.
But...
Klaus wrote:of course you can import an image into a standalone:
How do I open that standalone (for example apk file)?
Klaus wrote:import paint from file "path/to/file.jpg"
and where to put this line?
Klaus wrote:You will need to save it before closing your app and "import" it again,
when the app starts the next time.
This also not clear for me since my app do not have any Save nor Import functions...

Can you please clarify?
Thanks.

keram

Re: import image in standalone

Posted: Tue Jul 08, 2014 12:04 pm
by Klaus
Hi Keram,
keram wrote:
Klaus wrote:of course you can import an image into a standalone:
How do I open that standalone (for example apk file)?
I thought we were talking about importing an image at runtime, means the app is open and running!?
keram wrote:
Klaus wrote:import paint from file "path/to/file.jpg"
and where to put this line?
Wherever you want to import an image! 8)
keram wrote:
Klaus wrote:You will need to save it before closing your app and "import" it again,
when the app starts the next time.
This also not clear for me since my app do not have any Save nor Import functions...
Yes, that's what I said :D

Just like storing "preferences" in a separate file in the users "prefs" or "documents" folder.
In the end it depends where and how you need to import an image.


Best

Klaus

Re: import image in standalone

Posted: Wed Jul 09, 2014 1:51 am
by Simon
Hi Keram,
Check out this little stack
http://forums.livecode.com/viewtopic.ph ... 68#p103136
Just add some photos and text and then look in Documents/myPlants/Preferences.txt
Read that file and you'll see how it works.
Add breakpoints and step through the code.

Simon

Re: import image in standalone

Posted: Wed Jul 09, 2014 4:58 am
by keram
Thanks Simon,
It's a really good example.
keram