imported image not stored

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

imported image not stored

Post by robm80 » Sat Jul 19, 2014 8:21 am

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

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: imported image not stored

Post by WaltBrown » Sat Jul 19, 2014 10:21 am

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
Walt Brown
Omnis traductor traditor

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: imported image not stored

Post by Klaus » Sat Jul 19, 2014 2:43 pm

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

robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

Re: imported image not stored

Post by robm80 » Sun Jul 20, 2014 5:36 am

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.

Post Reply