Page 2 of 8
Re: Images in Livecode
Posted: Tue Aug 01, 2017 8:36 am
by Klaus
Hi David,
this will work in the IDE and in a standalone, if you added the folder "images" via the "Copy fikles" tab in the standalone builder settings:
Code: Select all
on mouseup
## Reference image:
set the filename of img 1 to (specialfolderpath("resources") & "/images/crow.jpg")
## Or directly import the image, was not sure what you were after:
put url("binfile:" & specialfolderpath("resources") & "/images/crow.jpg") into img 1
end mouseup
In the IDE specialfolderpath("resources") points to the folder the current stack is in.
Best
Klaus
Re: Images in Livecode
Posted: Tue Aug 01, 2017 8:41 am
by bidgeeman
Hi Klaus,
Thanks. So basically it won't load from a folder while in Livecode but will load when it is compiled is that correct?
Regards
Bidge
Re: Images in Livecode
Posted: Tue Aug 01, 2017 9:24 am
by AndyP
Attached is your script modified with my example.
Re: Images in Livecode
Posted: Tue Aug 01, 2017 9:25 am
by Klaus
So what part of "
... this will work in the IDE and in a standalone..." did you not understand?

Re: Images in Livecode
Posted: Tue Aug 01, 2017 9:55 am
by bidgeeman
Oh thanks Andy. I wasn't following what you were suggesting but now I can see now how well the script works.
Klaus, yes I can see that your way is the easiest way to do it with my basic understanding and I appreciate the advice

It's a bit hard to work blind that way though.
Thanks again
Bidge
Re: Images in Livecode
Posted: Wed Aug 02, 2017 7:52 am
by bidgeeman
Hi.
I have another question please.
Is it possible to have an answer dialogue appear with a different color background?
I have set a dark color to one of my cards and it seems to be locked into the answer dialogue box as the default background color.
Code: Select all
answer info "This will erase your current image. Continue?" with "Yes" or "No"
Thanks again
Bidge
Re: Images in Livecode
Posted: Wed Aug 02, 2017 8:34 am
by richmond62
Re: Images in Livecode
Posted: Wed Aug 02, 2017 8:58 am
by bidgeeman
Hi richmond62.
That is amazing!

These are the sorts of tips that are really hard to find.
Thank you so much.
Bidge
Re: Images in Livecode
Posted: Wed Aug 02, 2017 10:50 am
by richmond62
These are the sorts of tips that are really hard to find.
I didn't "find" that: I just did a bit of
thinking AND
looked in the stack list, and found "
Answer Dialog" . . . . boom, boom
https://en.wikipedia.org/wiki/Basil_Brush
Re: Images in Livecode
Posted: Wed Aug 02, 2017 10:56 am
by bidgeeman
EDIT: Oh...stack list?
EDIT: Ahhh...I just found it in the dictionary under "Answer Color"
Bidge
Re: Images in Livecode
Posted: Wed Aug 02, 2017 11:46 am
by Klaus
Hi David,
remember that LC is made with LC, so everything in the IDE is a stack resp. scripted and can be modified!
Best
Klaus
Re: Images in Livecode
Posted: Wed Aug 02, 2017 12:52 pm
by Klaus
Klaus wrote:...remember that LC is made with LC, so everything in the IDE is a stack resp. scripted and can be modified!
IMPORTANT ADDENDUM: Except the engine and its functionality, which is made with C++

Re: Images in Livecode
Posted: Wed Aug 02, 2017 4:49 pm
by bogs
Klaus wrote:Hi David,
remember that LC is made with LC, so everything in the IDE is a stack resp. scripted and can be modified!
Best
Klaus
Also remember that the worst thing that can possibly happen if you edit the ide is that you might have to reinstall it

so don't be afraid to poke around, it can't possibly bring about the end of the universe
*Edit - disclaimer: this doesn't mean that a possibly worse situation could arise, like modifying code and having it appear to work but introducing a logic flaw that slowly degrades reliability over time, for example.
...don't drink milk if your lactose intolerant
...look both ways before crossing the street
...etc
Re: Images in Livecode
Posted: Fri Aug 04, 2017 10:09 pm
by SparkOut
16 times I've endured the end of the universe. Never a single occasion that LiveCode IDE has been the cause.
Re: Images in Livecode
Posted: Sat Aug 05, 2017 5:28 am
by bogs
See? Even an expert agrees !
[Note to self : start working out code needed to end universe...

]