Page 1 of 3

Background image not saving in stand alone

Posted: Thu Jan 24, 2013 7:46 am
by magice
I know i have done it a dozen times. I import an image as a control, then set it as a background pattern. In the past it has always worked fine. In the stack I am currently working on, the image does not save in the standalone. Is there a standalone setting that i might be missing?

Re: Background image not saving in stand alone

Posted: Thu Jan 24, 2013 3:17 pm
by Mark
Hi,

You can't save stacks that are part of standalones. You have to keep your modifiable stack outside a standalone and in a user.

There's a lot of info about this here on the forum. Use the search field in the top-right.

Kind regards,

Mark

Re: Background image not saving in stand alone

Posted: Thu Jan 24, 2013 4:31 pm
by dave_probertGA6e24
Hi,

I read that post in a different way than Mark, but still am not completely sure about the context of the problem. The image is 'imported' as a control (that can only be done in the IDE - AFAIK) - therefore it's likely to be some other aspect of the image or something.

Just to clarify..
You are working in the IDE
You import an image as a control in the IDE
You set it as a background in the IDE
You save the stack
You save a standalone executable
The background does not show

Is that correct?

What is the image type?
Where are you importing the image to - ie main stack or a substack ?
You are not setting the image filename at any point in the code?

You can try adding it in the 'Copy Files' section of the standalone Settings - that might work.

Sometimes it's best to write a request/question very simply - like to a child or non-english reader - so that everyone can easily understand what you want ;) and then there are also no ambiguities.

Cheers,
Dave

Re: Background image not saving in stand alone

Posted: Thu Jan 24, 2013 5:33 pm
by magice
dave_probertGA6e24 wrote: Just to clarify..
You are working in the IDE
You import an image as a control in the IDE
You set it as a background in the IDE
You save the stack
You save a standalone executable
The background does not show

Is that correct?
That is correct.
dave_probertGA6e24 wrote:
What is the image type?
Where are you importing the image to - ie main stack or a substack ?
You are not setting the image filename at any point in the code?
in my attempts to get it to work i have tried many combinations of things.
I have tried the image as both gif and jpg.
I have set the background of the stack as the image (there are no substacks)
I have tried setting each card background as the image (Preferred)
I have just left the image in the stack as the lowest layer of each card.
and of course in every instance the image was imported as a control.
I have tried every combination of the above. I even tried saving the image as a custom property of the stack, then having the stack set the backgroundPattern to that custom property on openStack
To test the image, i even made a new stack, imported the image as a control and saved that stack as a standalone. The image was there in that standalone fine. So, I have concluded that the problem is in my stack.
The question is what might I have done in a stack that would would prevent a control image from saving to standalone.

Re: Background image not saving in stand alone

Posted: Thu Jan 24, 2013 9:47 pm
by Simon
the stack set the backgroundPattern to that custom property on openStack
The "backgroundPattern" is interesting. Are you working with a 128 x 128 image (or something small like that) and repeating it?
Were all your test done using the "backgroundPattern"? It could just be that your image ID is off. Or have you tried it just as an imported image?

Simon

Re: Background image not saving in stand alone

Posted: Fri Jan 25, 2013 12:30 am
by magice
Simon wrote:
the stack set the backgroundPattern to that custom property on openStack
The "backgroundPattern" is interesting. Are you working with a 128 x 128 image (or something small like that) and repeating it?
Were all your test done using the "backgroundPattern"? It could just be that your image ID is off. Or have you tried it just as an imported image?

Simon
just to clarify
the standalone does not have or require a save function
All references to saving are from the IDE

The image is large it covers the entire background of the stack. It is not repeated. I have tried it as just an imported image. I did not use backgroundPattern on every test. Besides, the image itself is empty when the stack is saved to standalone. I have long since deleted the source, and the image is still there in the ide, so it is properly imported into the stack. Still, it does not carry over to the standalone. I would upload the stack, but it it 1.39mb and this forum has a 256k limit. This really has me stumped.

Re: Background image not saving in stand alone

Posted: Fri Jan 25, 2013 1:26 am
by Simon
Besides, the image itself is empty when the stack is saved to standalone.
OK, now I am well confused.
You know the image is empty in the standalone, might it just be off screen?
Maybe something like "answer the loc of img myImage"
or
"answer the rect of img myImage" to check that the size has not changed
or
"answer the vis of img myImage" to see if it's hidden
There are a bunch of these you can check for blendlevel, filename ect.
I have long since deleted the source, and the image is still there in the ide,
Meaning it exists only in the stack not on your computer?

Sorry if I'm not much help, but I guess you've proved by building a new stack that an imported image will show up in a standalone.

Simon

Re: Background image not saving in stand alone

Posted: Fri Jan 25, 2013 2:11 am
by magice
Oddly enough, if I reference a source and include that source in the export, the image will show up. In other stacks I can import this image as a control and save as a standalone and the image saves with it. In this stack it will not. The only thing I can think of, is that maybe there is some sort of memory limit that I am exceeding when saving this stack as a standalone, and the image data is getting truncated. I suppose I can just include the image with the app and give the user the option to "re-skin" the background by replacing the image, but I would prefer a simple portable executable file that needs no supporting files.

Re: Background image not saving in stand alone

Posted: Fri Jan 25, 2013 8:24 pm
by jacque
I'm confused too. It sure sounds like the image is a referenced one and not an imported one. At least, it's acting that way. Did you double-check that there is no filename assigned to the image?

If the image is empty when you build the app, it means the imported content was removed and there is only an empty image control. The image won't show unless it references a resource on disk. To keep the image inside the app, you need to build while the image contains something.

There is no memory limit that would affect this, I'm pretty sure it's due to the content of the stack when you do the build. You could see if your other stacks have the "Copy referenced files" checkbox set in the Copy Files pane of the standalone settings. That would add the referenced image files to the standalone, but they would be in a separate folder outside the app. On a Mac, it would appear to be a single app because the resources are inside the app bundle. On a Windows standalone, the image folder will be in the same folder with the .exe.

Re: Background image not saving in stand alone

Posted: Sat Jan 26, 2013 6:43 am
by magice
jacque wrote:I'm confused too. It sure sounds like the image is a referenced one and not an imported one. At least, it's acting that way. Did you double-check that there is no filename assigned to the image?

If the image is empty when you build the app, it means the imported content was removed and there is only an empty image control. The image won't show unless it references a resource on disk. To keep the image inside the app, you need to build while the image contains something.

There is no memory limit that would affect this, I'm pretty sure it's due to the content of the stack when you do the build. You could see if your other stacks have the "Copy referenced files" checkbox set in the Copy Files pane of the standalone settings. That would add the referenced image files to the standalone, but they would be in a separate folder outside the app. On a Mac, it would appear to be a single app because the resources are inside the app bundle. On a Windows standalone, the image folder will be in the same folder with the .exe.
It is definitely not a referenced image when imported as a control. It has no source listing in the properties box, and the source file was removed yet the image still opens in the ide. A few other tests revealed that the image is there in the standalone, but it is blank (plain white). I tested this by moving the image to the top layer of the stack and saving as a standalone. The standalone then had all of its elements covered and the stack was just a white window. I have since created multiple test stacks, but have not had the same problem. I'm not sure what is causing it but it has me pulling my hair out. (and I can't afford to lose much more) This stack was actually the first complete app. I wrote it back in 2009. I am now adding features and tweaks that were beyond my abilities at that time. I am wondering if I somehow corrupted the stack back then without realizing it.

Re: Background image not saving in stand alone

Posted: Sat Jan 26, 2013 6:51 am
by Simon
Go and get a free dropbox account and post your stack.
This is too mysterious to figure out without the code.

Simon
ps No guarantee that I can solve it even then :)

Re: Background image not saving in stand alone

Posted: Sat Jan 26, 2013 4:46 pm
by magice
Simon wrote:Go and get a free dropbox account and post your stack.
This is too mysterious to figure out without the code.



Simon
ps No guarantee that I can solve it even then :)
dropbox created, just need an email so I can share the folder. Unless this works

https://www.dropbox.com/sh/qfbcy7b0bdih9t9/N7RxvQt3rX

I have included the 2 text files and the icon file that are referenced during export. I did not include the background image in question. When you open the stack you will see the image there in the background.

edit: Fair warning this was my first stack. I did the original scripting without understanding repeat loops. Consequently there are a lot of repetitive lines that could have been simplified. I am in the process of upgrading the script, but there is still a lot to be done.

Re: Background image not saving in stand alone

Posted: Sat Jan 26, 2013 5:22 pm
by sturgis
if you drop the stack in the dropbox public folder (inside dropbox) you can then right click the stack and copy its public link address and post it here.

Re: Background image not saving in stand alone

Posted: Sat Jan 26, 2013 5:32 pm
by magice
sturgis wrote:if you drop the stack in the dropbox public folder (inside dropbox) you can then right click the stack and copy its public link address and post it here.
Maybe they are doing something different with free accounts now, but there is no "Public folder" However i made that folder shareable and according to the instructions this link should work.

https://www.dropbox.com/sh/qfbcy7b0bdih9t9/N7RxvQt3rX

Re: Background image not saving in stand alone

Posted: Sat Jan 26, 2013 6:30 pm
by sturgis
Looks like there may be a bug in 5.5.3. When opening your stack in 5.5.3 I can't see the background, can't export (export seems entirely broken)

When opening it in 5.5.1 everything works fine.

Also seems that something else has gone wrong with error reporting in 5.5.3, it reports a missing comma quite often but the error message doesn't usually apply.

Build with 5.5.1 for now, hopefully there will be a maint update to fix this. Or maybe there already is, will check and see if there is a newer build that I haven't heard about.