Page 1 of 1

Changing size of images in groups

Posted: Sat Apr 28, 2018 9:24 pm
by DavidF.
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.

Re: Changing size of images in groups

Posted: Sat Apr 28, 2018 10:29 pm
by Klaus
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

Re: Changing size of images in groups

Posted: Sat Apr 28, 2018 10:39 pm
by DavidF.
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.

Re: Changing size of images in groups

Posted: Sat Apr 28, 2018 10:57 pm
by bogs
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:

Re: Changing size of images in groups

Posted: Sat Apr 28, 2018 11:45 pm
by dunbarx
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

Re: Changing size of images in groups

Posted: Sun Apr 29, 2018 12:00 am
by DavidF.
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.

Re: Changing size of images in groups

Posted: Sun Apr 29, 2018 3:07 am
by dunbarx
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

Re: Changing size of images in groups

Posted: Sun Apr 29, 2018 4:26 am
by bogs
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 10099 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 :)