Resize Images sent to Substack
Posted: Sun May 25, 2014 6:58 pm
Hello. I got a fairly basic question regarding the resizing of images as done per the intro to Livecode tutorial when making the task list. Here is what I did.
I made a substack named "resources"
Made a card "images"
on the preopenstack handler of the main stack i have the line
send "resizeImages" to card "images" of stack "resources"
on the card script I have the following code
Now this code works fine and the images will resize. It works for only one card however. As soon as I change the card on the main stack such as [go to card "menu" of this stack] all the images in stack "resources" return to their original size. There are no other handlers that resize images.
What can I do to keep the images resized rather than having to execute the "resizeImages" handler on every card?
I made a substack named "resources"
Made a card "images"
on the preopenstack handler of the main stack i have the line
send "resizeImages" to card "images" of stack "resources"
on the card script I have the following code
Code: Select all
on resizeImages
put the height of stack "Med Engagement" into tHeight
put the width of stack "Med Engagement" into tWidth
set the height of image "arrowSmall" of me to 0.09 * tHeight
set the width of image "arrowSmall" of me to 0.16* tWidth
set the height of image "Splash Screen 1.jpg" of me to tHeight
set the width of image "Splash Screen 1.jpg" of me to tWidth
set the width of img "searchButton.png" of me to 0.18 * tWidth
set the height of img "searchButton.png" of me to 0.09 * tHeight
set the width of img "myMeds.png" of me to 0.16 * tWidth
set the height of img "myMeds.png" of me to 0.08 * tHeight
set the width of img "menuButton.png" of me to 0.16 * tWidth
set the height of img "menuButton.png" of me to 0.07 * tHeight
set the width of img "docButton.png" of me to 0.17 * tWidth
set the height of img "docButton.png" of me to 0.07 * tHeight
set the width of img "backButton.png" of me to 0.17 * tWidth
set the height of img "backButton.png" of me to 0.08 * tHeight
end resizeImages
What can I do to keep the images resized rather than having to execute the "resizeImages" handler on every card?