Page 1 of 1

imported image not stored

Posted: Sat Jul 19, 2014 8:21 am
by robm80
After importing an image to use it as an icon for a button, no problem.
I save the stack, close it and after that I reload the stack again:
In the application browser I see that the image has gone and of course the button's icon too.
Another image I had imported before I closed the stack and with "set the rect of last image to the rect of button "pict",
resized to the size of button "pict", is still present, but now has it's original size. Awful...
What to do? Something in "on openfile" perhaps?

Thanks,Rob

Re: imported image not stored

Posted: Sat Jul 19, 2014 10:21 am
by WaltBrown
Rob,
In an openCard handler in the stack script, I tried the

Code: Select all

set the rect of img "myImage" to the rect of btn "myButton
and it resized the image perfectly. It's not persistent though, and the imported image will be saved in it's original scale when the stack is closed.

Maybe you can post a stack with the problem?

Did you "Close" the stack, or "Close and remove from memory" the stack? (I don't know if that's specifically the issue, I couldn't reproduce the lost image problem).

Walt

Re: imported image not stored

Posted: Sat Jul 19, 2014 2:43 pm
by Klaus
Hi Rob,

to prevent the image from resizing to its original dimensions you need to LOCKLOC the image:
...
set the rect of last image to the rect of button "pict"
set the lockloc of last image to true
...
But no idea why the image does not get saved with the stack!?
We are NOT talking about a standalone, right?


Best

Klaus

Re: imported image not stored

Posted: Sun Jul 20, 2014 5:36 am
by robm80
But no idea why the image does not get saved with the stack!?
I couldn't reproduce the lost image problem.
Thanks to the gift of Klaus the Lockloc solved my problem. Because of the fickleness of the last image, I had a stackscript
to repeat the import of the last image when opening the stack.
Once I removed the stackscript - Lockloc made it superfluous - the problem was solved.