Resizing images

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
leston12
Posts: 25
Joined: Thu Mar 28, 2013 8:25 pm
Location: Utah, USA

Resizing images

Post by leston12 » Tue May 14, 2013 10:03 pm

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?
Leston

CoffeeCone
Posts: 64
Joined: Fri Apr 26, 2013 8:38 am

Re: Resizing images

Post by CoffeeCone » Wed May 15, 2013 2:48 am

Have you tried setting the lockLoc of the image to true?
Learning LiveCode, one step at a time.

leston12
Posts: 25
Joined: Thu Mar 28, 2013 8:25 pm
Location: Utah, USA

Re: Resizing images

Post by leston12 » Wed May 15, 2013 5:15 am

Hmmm, no I haven't tried that. The images are all on a card in a substack, being shown as icons on buttons.
Leston

Klaus
Posts: 13858
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Resizing images

Post by Klaus » Wed May 15, 2013 1:29 pm

Hi Leston,

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

leston12
Posts: 25
Joined: Thu Mar 28, 2013 8:25 pm
Location: Utah, USA

Re: Resizing images

Post by leston12 » Fri May 17, 2013 12:24 am

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.
Leston

Post Reply

Return to “Android Deployment”