I am working on my first app. It will be cross platform (Android, iOS).
I have implemented a handler used in one of the LC Lessons (the TickedOff app) that stores some custom properties in images, and uses them to resize each image based on the screensize, triggered on a resizeStack message. The images are used in the icon, hilitedIcon, and disabledIcon properties of buttons.
So, I set the rect of the stack to the screenrect on in the preopenstack handler, and call this handler which resizes the images based on the stack width and height. Which works to this point. I lay out the screen and size each button to match its icon image.
However, when I run the app on a device and click on one of the buttons , the images magically change back to their original size. This doesn't happen in the development environment.
Has anyone seen this before? or can give me a direction to pursue to try to figure out why this is happening or if not, at least some kind of a workaround?
Resizing images
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 64
- Joined: Fri Apr 26, 2013 8:38 am
Re: Resizing images
Have you tried setting the lockLoc of the image to true?
Learning LiveCode, one step at a time.
Re: Resizing images
Hmmm, no I haven't tried that. The images are all on a card in a substack, being shown as icons on buttons.
Leston
Re: Resizing images
Hi Leston,
welcome to the forum!
Do it, this will ease your pain!
This "technique" will apply to ALL images:
a: set the images LOCKLOC to TRUE via the INSPECTOR -> "Size & Position"
or
b. in a script:
...
set the lockloc of img "xyz" to TRUE
...
Best
Klaus
welcome to the forum!
Hmmm, no I haven't tried that.
Do it, this will ease your pain!
The images are all on a card in a substack, being shown as icons on buttons.
This "technique" will apply to ALL images:
a: set the images LOCKLOC to TRUE via the INSPECTOR -> "Size & Position"
or
b. in a script:
...
set the lockloc of img "xyz" to TRUE
...
Best
Klaus
Re: Resizing images
Thank you Klaus and Coffee,
I set the lockLoc to True for each of the images, and lo and behold the problem went away.
YAYYYYY. I would have never guessed that one.
I set the lockLoc to True for each of the images, and lo and behold the problem went away.
YAYYYYY. I would have never guessed that one.
Leston