Changing size of images in groups

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: heatherlaine, Klaus, FourthWorld, kevinmiller

Post Reply
DavidF.
Posts: 15
Joined: Sat Sep 10, 2016 3:00 pm

Changing size of images in groups

Post by DavidF. » Sat Apr 28, 2018 9:24 pm

hi,

I have created a group made up of various images. I have made changes to the original dimensions of these images. However as soon as I place them into the group, they snap back to their original size. Also any changes I make to them while in the group, don't stick - as soon as I come out of "Edit Group", they are back to their original size. I know I could set "Lock size and position", but I anticipate doing a fair bit of manual adjustment to these images, and I'd rather not have to keep switching this setting on and off. Is there any way of working with images in groups that makes them keep whatever dimensions i have currently assigned to them?

-- DavidF.

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

Re: Changing size of images in groups

Post by Klaus » Sat Apr 28, 2018 10:29 pm

Hi David,
Is there any way of working with images in groups that makes them keep whatever dimensions i have currently assigned to them?
yep, set their "lockloc" to true! :-D
Sorry, couldn't resist, but this is the only way to handle this in Livecode!

Best

Klaus

DavidF.
Posts: 15
Joined: Sat Sep 10, 2016 3:00 pm

Re: Changing size of images in groups

Post by DavidF. » Sat Apr 28, 2018 10:39 pm

Thanks Klaus! You know in the back of my mind I know this is how you have to do it, yet I always seem to hope to find a way round it.

It feels particularly aggravating somehow when you're working with a group and trying to get everything arranged as you want it.

-- DavidF.

bogs
Posts: 1913
Joined: Sat Feb 25, 2017 10:45 pm

Re: Changing size of images in groups

Post by bogs » Sat Apr 28, 2018 10:57 pm

Locking the size doesn't prevent you from either manually resizing the images or doing it through code, which, while I'm sure you know this, is being stated for others that might not but come along later :wink:
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5424
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Changing size of images in groups

Post by dunbarx » Sat Apr 28, 2018 11:45 pm

One could surely set the lockloc under script control.

But is there a message sent when such an operation takes place? In that case, one could make a plug-in that automatically (pseudo):

Code: Select all

on messageThatNoticesNewImportedImage
set the lockLoc of last image to "true"
...
Craig Newman
Last edited by dunbarx on Sun Apr 29, 2018 2:58 am, edited 1 time in total.

DavidF.
Posts: 15
Joined: Sat Sep 10, 2016 3:00 pm

Re: Changing size of images in groups

Post by DavidF. » Sun Apr 29, 2018 12:00 am

bogs wrote:
Sat Apr 28, 2018 10:57 pm
Locking the size doesn't prevent you from either manually resizing the images or doing it through code, which, while I'm sure you know this, is being stated for others that might not but come along later :wink:
well... but setting lockLoc = true would stop me manually resizing it, wouldn't it?

In the fullness of time I plan to have some scripting to manipulate the group and its components, it's just a bit annoying in the preliminary stage of positioning and resizing images to have to keep turning lockLoc on and off. But as dunbarx suggested there's probably some scripting that could help automate that.

-- DavidF.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5424
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Changing size of images in groups

Post by dunbarx » Sun Apr 29, 2018 3:07 am

So there is indeed a message sent when a new image is created (newImage), but it is sent to the image, not to the card or stack.

I have always had to rush in and set the lockLoc os a newly imported and resized image by hand, before nudging it a single pixel made it revert to it s original rect. I think this might warrant a request to the team, so make the default lockLoc of a new image "true".

Craig

bogs
Posts: 1913
Joined: Sat Feb 25, 2017 10:45 pm

Re: Changing size of images in groups

Post by bogs » Sun Apr 29, 2018 4:26 am

DavidF. wrote:
Sun Apr 29, 2018 12:00 am
well... but setting lockLoc = true would stop me manually resizing it, wouldn't it?
If you mean by the resize handles, yes, however that is not the only way to manually resize something :wink:
Selection_003.png
Setting lockLoc
Selection_004.png
Manually resizing...
Selection_005.png
Or you could even....
Selection_005.png (85.54 KiB) Viewed 286 times
Or you could just type it in. It is habit for me now to set the lockLoc to true when plopping the image control on the form, but when I import images, I set the lockLoc and then type in the size I want, it usually works very well (for me). Hope it helps you as well :)
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”