Hi Ronny (and anyone interested),
attached is the latest update of the FREE BDSwapImage macro. The latest version has built upon the QuickSwap module (select 2 images and then swap them with one click) by adding a QuickSwapSize module which not only swaps 2 images, but also swaps their sizes.The macro also has the original module SwapImage module which pops up a userform and allows the user to choose how the 2 images are swapped (e.g. swap the position of their top left corners, bottom right corners, etc). Here is a screen capture of how the modules appear in the Macro Manager docker, assign shortcut buttons/keystrokes to make them one click away:
Refer to the video below to see the intented use of this macro:
Hi Ronny,
the macro has been revamped now...thanks to assistance from John and Sancho. I didn't even ask for help and those guys are so great they just helped me! Sancho sent me some code which gives one of the modules dual functionality.
The macro now works as follows:
Really great!. You will probably only ever use the QuickSwap module. Just remember to hold Shift as you run it to swap shape sizes.
Thank you very much John and Sancho, you guys are totally awesome.
Best regards,Brian.
p.s. on the previous version it did work, by the way. The QuickSwapSize macro did all 3 swaps, but only worked if both shapes were on the same layer. The code now also works if shapes on are different layers. You may have misunderstood me and thought you had to run the extra sub to swap the stacking order (which would have already been done).
Here is the macro in action....please note the 2 smaller images are on layer 1, one below the yellow rectangle, one above it. The large image is on layer 3
Wow! This is really cool and exactly what I wanted.
May I suggest that you (if possible) add the stacking order option to the SwapImage window too. Not that I need it but it would make the dialog more complete.
Many thanks to all John and Sancho as well!
...your wish is my command....you must think I am the genie in the magic lantern...LOL. Just kidding Ronny. OK, attached is the fully rewritten macro in all aspects. The QuickSwap is what you just saw, the SwapImage lets you choose a reference point (alignment point) and then calls the QuickSwap code to do its thing. This means you get the Shift (to swap sizes) functionality with the buttons on the form too! There is a message on the form to let you know that holding Shift while clicking a button swaps shape sizes. Hopefully this one is a done deal now
I could not have pulled it off so well without the help from the guys. Sancho and John are the nicest guys and so generous in sharing their hard-earned knowledge. Thanks so much guys!
I already thought of another nice feature, which I will add for my own personal use, but may not be worth posting when done. Swap rotation angle!! I would mainly use it for bitmaps, but the issue would be if you tried to use it with shapes in certain situations....such as drawing a rectangle, rotating it and then converting to curves. The Property Bar would show zero in the rotation field, so the macro wouldn't rotate the shape being swapped with it. With bitmaps this would never occur. I guess there could be a checkbox for "Bitmaps only", so in those situations where it would not work with some shapes, bitmaps only could be selected.
I will give this some thought.