Page 1 of 1

Resize Images in Group

Posted: Thu May 01, 2008 10:49 pm
by danrg7
How can I resize images in a group when the group is resized? I want the images to stay in the proper positions relative to each other and to the new group rectangle. Is there any way I can do this?

Posted: Fri May 02, 2008 11:40 am
by BvG
There's various ways to do that. It mostly depends on how you actually change the size of the group. one way would be to send a "YouAreNowResized" message to the group, in every handler who resized it. Another approach would be to not resize the group directly, but to send it a "resizeNow" message, with the new rectangle it should take, then in that handler do all the resizing and moving.

Theoretically you could set a custom property of the group, and use the setprop style of command structure to do your thing. I have never used this approach, so i'm not sure what particularities this entails.

After you have decided on how to notify your group of a resize, you have to set the loc and rect of the objects within it. This is not much different from how to set them at the stack/card level. The most important difference is that all the positional and size properties will have to change relative to the group, and not the origin (0,0).


useful docu topics:
send command
setprop control structure
rectangle property
topleft property (and all it's siblings)
width property
height property
location property