Page 1 of 1

Images in standalones

Posted: Thu Sep 09, 2021 10:47 am
by dalkin
I've read the lessons and tried the following without success.

I want to save the entries in various fields and it works a treat when I launch a splash stack (call it the primary stack) that, in turn, launches the stack with the for-saving fields (call it the secondary stack). All good, no problem. The problem arises though with an image in the 'secondary' stack. In the IDE, the path to the image is shown in the secondary stack, but the 'save-as-standalone' dialog is only relevant to the 'splash' stack and no variation is working to 'embed', or otherwise reference, the referenced image file in the 'secondary' stack. In the standalone build, the image does not appear.

Load your 38s, spin the cylinder, pull the trigger and put me out of my misery.

Re: Images in standalones

Posted: Thu Sep 09, 2021 11:57 am
by Klaus
Hi dalkin,

I'm german, no guns over here! 8)

Let me see if I get it right.
1. You have a stack "stack1" that is turned into a standalone -> the famous SPLASH stack
2. You have another separate stack that gets saved -> "stack2"
3. 1. opens 2.
4. There is an image in "stack2" that is not displayed in the runtime.

Did you add that image to stack2?
If yes, why not just IMPORT AS CONTROL that image?
If not, how does the image get into that stack2?

If you want to reference images use RELATIVE pathnames = relative to the (runtime) stack.
Do like this:
1. In the IDE put the image(s) into the folder with the stack1, either as separate files of in a folder
2. Enter the filename in the inspector for that image RELATIVE, means simply the filename without
any folder reference -> my_image.jpg
3. Add your image or folder of images to your later runtime via "Copy files" in the "Standalone Application settings"
4. This way LC will map that folder to your runtime app structure as if it was in the IDE:
stack1
my_image.jpg
5. You can also access that folder via script with- -> specialfolderpath("resources")
This folder will also work in the IDE where it point to the folder the current stack resides in.
So if 2. does not work for you, you can later script:

Code: Select all

...
set the filename of image "your formerly missing image" of cd 1 of stack "stack2" to (specialfolderpath("resources") & "/my_image.jpg")
...
Hope I got it right! :-)


Best

Klaus

Re: Images in standalones

Posted: Thu Sep 09, 2021 3:20 pm
by stam
What Klaus says! (as always ;) )

either import as control and reference it by it's ID, or copy as external file in the standalone build settings and reference it via specialFolderPath("resources")/<image file name>