![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
Moving and Sizing an Object Drawing Layer
![](/sites/default/files/styles/thumbnail/public/hegedus/profile-images/2024-12/ANDY_HEGEDUS_0.jpg?itok=gcodp5H3)
hegedus
I am creating an interface for image analysis and I need to allow the user a limited scope of setting an ROI box. The interface has multiple images including one that will have an ROI box. I need to allow the user to move the box in X and Y and to scale it in X and Y. What I was thinking was using the arrow keys to move similar to what is done when the drawing tools are active and an object has been selected. Arrow keys move and shift arrow moves faster. I would like to use option/alt arrow to size. I would prefer not to have the drawing tools active because it would open up too many options for mischief on behalf of the user.
Is there some existing code someone can share as a starting point before I struggle in writing my own?
Andy
March 2, 2018 at 06:04 am - Permalink
March 2, 2018 at 06:43 am - Permalink
I like your suggestion. I was going down an alternate route using a wave to create a boundary and using imageBoundaryToMask and creating controls to adjust the values in the wave. The marquee is a more direct way.
Thank you for the suggestion.
Andy
March 2, 2018 at 08:16 am - Permalink
Also here is what I put together
BoundBox wave holds the global positions so I can retrieve them
BoxX,BoxY is wave to feed imageBoundaryToMask width=4608, height=3288, xwave=boxx,ywave=boxy, seedx= mean(boxX), seedy=mean(boxY)
Andy
March 2, 2018 at 08:59 am - Permalink
March 2, 2018 at 10:56 am - Permalink